From patchwork Tue Mar 19 11:23:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dirk Gouders X-Patchwork-Id: 13596593 Received: from mx10.gouders.net (mx10.gouders.net [202.61.206.94]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A26F27E583 for ; Tue, 19 Mar 2024 11:24:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.61.206.94 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710847454; cv=none; b=XSHS3V6MZTAWYWZCNoEEUkgzMj6EMuZqBb00jCv7aHAwjn6gnPVhgfrMRwNTmwH62YduzzYB0vYAVOdowX5tlndme0ao6+ZVfZCACRVvb2exa4ukRhQLfWNPesvl3GDQhAZ75Ff8Kvm9n3YH/Nd80mwGa6N3Dh4X0hb27LdNvfM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710847454; c=relaxed/simple; bh=MNZSgGo6UitWonYONsBoyHzJ5q56OFFJdZjurv459PQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=q0Lb3nbb7l5g1Ff9//H2beII3IpyrGGqd6dHZiGLSGEadS3b7nlpehpheY9O94nUq+lc7pDUl8ODlhOhqC7Gv3ZY7Aq2AJ4lG0J0+OzvreZJUQrl3vQr7LtbDjAl0+5uIwt7TnqmiZKScgjD3mK6FwpXTWHeaM+HdiDnagR9La4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=gouders.net; spf=pass smtp.mailfrom=gouders.net; dkim=pass (1024-bit key) header.d=gouders.net header.i=@gouders.net header.b=KPkIyqUw; arc=none smtp.client-ip=202.61.206.94 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=gouders.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gouders.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=gouders.net header.i=@gouders.net header.b="KPkIyqUw" Received: from localhost ([193.175.198.193]) (authenticated bits=0) by mx10.gouders.net (8.17.1.9/8.17.1.9) with ESMTPSA id 42JBO22U017014 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Tue, 19 Mar 2024 12:24:02 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gouders.net; s=gnet; t=1710847442; bh=MNZSgGo6UitWonYONsBoyHzJ5q56OFFJdZjurv459PQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=KPkIyqUwc03uLewTbf0pBpU3RTQzJx8Xh2K+dOm5muW1b7mGPwB7MN+RdnBmQqxup mNkdoeNke6jyu6JiCY+QlXkXAJGbDEWMAe/T6m9gmOWqmEuGCg1S0nXswxDR7XhDko KAYl7ZKjD4USeqx1t4ACRgBmy6I8vQguM6zHpCFM= From: Dirk Gouders To: git@vger.kernel.org Cc: Dirk Gouders , Junio C Hamano , Emily Shaffer Subject: [PATCH v2 1/5] MyFirstObjectWalk: use additional arg in config_fn_t Date: Tue, 19 Mar 2024 12:23:11 +0100 Message-ID: X-Mailer: git-send-email 2.43.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Commit a4e7e317 (config: add ctx arg to config_fn_t) added a fourth argument to config_fn_t but did not change relevant function calls in Documentation/MyFirstObjectWalk.txt. Fix those calls and the example git_walken_config() to use that additional argument. Signed-off-by: Dirk Gouders --- Documentation/MyFirstObjectWalk.txt | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Documentation/MyFirstObjectWalk.txt b/Documentation/MyFirstObjectWalk.txt index c68cdb11b9..cceac2df95 100644 --- a/Documentation/MyFirstObjectWalk.txt +++ b/Documentation/MyFirstObjectWalk.txt @@ -210,13 +210,14 @@ We'll also need to include the `config.h` header: ... -static int git_walken_config(const char *var, const char *value, void *cb) +static int git_walken_config(const char *var, const char *value, + const struct config_context *ctx, void *cb) { /* * For now, we don't have any custom configuration, so fall back to * the default config. */ - return git_default_config(var, value, cb); + return git_default_config(var, value, ctx, cb); } ---- @@ -389,10 +390,11 @@ modifying `rev_info.grep_filter`, which is a `struct grep_opt`. First some setup. Add `grep_config()` to `git_walken_config()`: ---- -static int git_walken_config(const char *var, const char *value, void *cb) +static int git_walken_config(const char *var, const char *value, + const struct config_context *ctx, void *cb) { - grep_config(var, value, cb); - return git_default_config(var, value, cb); + grep_config(var, value, ctx, cb); + return git_default_config(var, value, ctx, cb); } ---- From patchwork Tue Mar 19 11:23:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dirk Gouders X-Patchwork-Id: 13596595 Received: from mx10.gouders.net (mx10.gouders.net [202.61.206.94]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 21B8A7E583 for ; Tue, 19 Mar 2024 11:24:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.61.206.94 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710847458; cv=none; b=iMy4ykndej7GhzQ7izvV9GxGlspWi+T/QbWm9yE6KdiK0Akizqxl+XBE7aHFd9oiNqWotIxQjKG4HQzzgSMDohIG72XXxOdo5iRWu6fC4PIeZOlhp+XZPs2fvV+OtoLuJtZpfXeHws9f1LmGiiEf//L4/zgH7N6qh9kRLgpXIe8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710847458; c=relaxed/simple; bh=DubbNUQKdlz/m2hwc0qzBsOrVzz98jd57+UvAxMLqLU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=RqFbveFh3EZLB3Jdmth0D62mxms+09rG/4pwTQ/SW36ZpzSiJ1sxYSaWCWbKqdZBe1LKDuF0QDpW63AuqOJBWYgjso1GgwzmPhaldb224JHP13BtFC5xtk/Jm4UnjtxoXEf6KshF8Yr8l1wTGqiHpJ18avFnvjdcZiXghjwl48w= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=gouders.net; spf=pass smtp.mailfrom=gouders.net; dkim=pass (1024-bit key) header.d=gouders.net header.i=@gouders.net header.b=MQCP33U5; arc=none smtp.client-ip=202.61.206.94 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=gouders.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gouders.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=gouders.net header.i=@gouders.net header.b="MQCP33U5" Received: from localhost ([193.175.198.193]) (authenticated bits=0) by mx10.gouders.net (8.17.1.9/8.17.1.9) with ESMTPSA id 42JBO7JW017018 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Tue, 19 Mar 2024 12:24:08 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gouders.net; s=gnet; t=1710847448; bh=DubbNUQKdlz/m2hwc0qzBsOrVzz98jd57+UvAxMLqLU=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=MQCP33U5deIuoTuTOONaIqBRVScXRRj57ZFKGNehUFp69yt86nVfImRg+sudAtMg3 vmJqcJ7fttDkbmBVcmAgPCxI/f0z0J8qcHjzQBJwhfIuOr3MotwbGWpd6m3gsnN+ML exwopcr9zWtFncs8XESvkf6HyvHdjwDb/PYGkKy0= From: Dirk Gouders To: git@vger.kernel.org Cc: Dirk Gouders , Junio C Hamano , Emily Shaffer Subject: [PATCH v2 2/5] MyFirstObjectWalk: fix misspelled "builtins/" Date: Tue, 19 Mar 2024 12:23:12 +0100 Message-ID: X-Mailer: git-send-email 2.43.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 pack-objects.c resides in builtin/ (not builtins/). Fix the misspelled directory name. Signed-off-by: Dirk Gouders --- Documentation/MyFirstObjectWalk.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/MyFirstObjectWalk.txt b/Documentation/MyFirstObjectWalk.txt index cceac2df95..c33d22ae99 100644 --- a/Documentation/MyFirstObjectWalk.txt +++ b/Documentation/MyFirstObjectWalk.txt @@ -525,7 +525,7 @@ about each one. We can base our work on an example. `git pack-objects` prepares all kinds of objects for packing into a bitmap or packfile. The work we are interested in -resides in `builtins/pack-objects.c:get_object_list()`; examination of that +resides in `builtin/pack-objects.c:get_object_list()`; examination of that function shows that the all-object walk is being performed by `traverse_commit_list()` or `traverse_commit_list_filtered()`. Those two functions reside in `list-objects.c`; examining the source shows that, despite From patchwork Tue Mar 19 11:23:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dirk Gouders X-Patchwork-Id: 13596596 Received: from mx10.gouders.net (mx10.gouders.net [202.61.206.94]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 14CEA54FAB for ; Tue, 19 Mar 2024 11:24:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.61.206.94 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710847463; cv=none; b=OAIFh46GqmbW+DxMbLYaSBB7iOmD4ICFzgyOTmqpP+y5GwLV/RbewcgS76WfOTzNW1d2wIhMdmkZ+MEmGz5f0e64JoM1xqFSpXCRKNe3C9Ap2Yr8kh9JoEraYzLz1rndTnQGgMlhg3GjnpWYmKA587kgoo4JjzUYgjPN9D8H17I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710847463; c=relaxed/simple; bh=9uC3WSBZkx5lJMcx9kg2PA0EIpkw/TmOx4kpx9xQTVM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=aDrDRBJrrXrm41HQcBDZ9YTg9XFbUXVVKaY8tOJfS2XjeP/01biy2Gxgwiy8M1DoLMM5ZRQunQhG4FMorD2xXEA/gS440jmQJFrgKCD+ifYmEFOGYmz7zuD9Mf0gKL6NbmwptspAZuGIsKF3Z6X6bvy1rGMdFopzSXF5WwANRIY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=gouders.net; spf=pass smtp.mailfrom=gouders.net; dkim=pass (1024-bit key) header.d=gouders.net header.i=@gouders.net header.b=SlI3iBJe; arc=none smtp.client-ip=202.61.206.94 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=gouders.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gouders.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=gouders.net header.i=@gouders.net header.b="SlI3iBJe" Received: from localhost ([193.175.198.193]) (authenticated bits=0) by mx10.gouders.net (8.17.1.9/8.17.1.9) with ESMTPSA id 42JBODk9017024 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Tue, 19 Mar 2024 12:24:13 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gouders.net; s=gnet; t=1710847453; bh=9uC3WSBZkx5lJMcx9kg2PA0EIpkw/TmOx4kpx9xQTVM=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=SlI3iBJeE1O3g4sfe+W9k/X/ZRNGTc3K16sn3cI3mflpLo+pqqYJCJG0rprxdxUsm 1l3v8K4qFue5sgjhjceOrRlZ1WOcnASJ71S3wMAd+JkUNC1M1oDdiVmtSmxJ1PegKy G09VLeWqz8h2VHyousCz3YcRVu6qE9gcvsRkZrBQ= From: Dirk Gouders To: git@vger.kernel.org Cc: Dirk Gouders , Junio C Hamano , Emily Shaffer Subject: [PATCH v2 3/5] MyFirstObjectWalk: fix filtered object walk Date: Tue, 19 Mar 2024 12:23:13 +0100 Message-ID: X-Mailer: git-send-email 2.43.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Commit f0d2f849 (MyFirstObjectWalk: update recommended usage) changed a call of parse_list_objects_filter() in a way that probably never worked: parse_list_objects_filter() always needed a pointer as its first argument. Fix this by removing the CALLOC_ARRAY and passing the address of rev->filter to parse_list_objects_filter() in accordance to such a call in revisions.c, for example. Signed-off-by: Dirk Gouders --- Documentation/MyFirstObjectWalk.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/MyFirstObjectWalk.txt b/Documentation/MyFirstObjectWalk.txt index c33d22ae99..a06c712e46 100644 --- a/Documentation/MyFirstObjectWalk.txt +++ b/Documentation/MyFirstObjectWalk.txt @@ -734,8 +734,8 @@ walk we've just performed: } else { trace_printf( _("Filtered object walk with filterspec 'tree:1'.\n")); - CALLOC_ARRAY(rev->filter, 1); - parse_list_objects_filter(rev->filter, "tree:1"); + + parse_list_objects_filter(&rev->filter, "tree:1"); } traverse_commit_list(rev, walken_show_commit, walken_show_object, NULL); From patchwork Tue Mar 19 11:23:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dirk Gouders X-Patchwork-Id: 13596597 Received: from mx10.gouders.net (mx10.gouders.net [202.61.206.94]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BFEE054FAB for ; Tue, 19 Mar 2024 11:24:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.61.206.94 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710847467; cv=none; b=tvipIqHcAhNemw4CJHdRX2tkgqAYkcM8KlWk/al51iKSxmeP6Xdd7/8Rj/Fr82qZdWzHxkrRWCeVFqkml0KbdfDAYlRfPhwK6M45m5cwk+YOYBHzfYRpKZNtUbFfo5m1glkLLons7ham22GmZ48HDMJEbjaSxodhYunBVc1W0kA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710847467; c=relaxed/simple; bh=XdMD5DKc7jJ4GfF5e10B85b7q6Nt51gJ091asD8uqVk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=p0MpRuiCTR4mgeCy34daqJwzgA4PPo219SNXbbRmGzCLqeewbww7JsA4swLAtUuHHBcxnR1qRIli44LH12waLOzNS78pkyH5Xu4hSEszc33gMi7enBkpyUGIBer5/bIrcgzqh/hs1lnfS6pCtM3ydbi3JuV6JUfNA9YTWC6igxs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=gouders.net; spf=pass smtp.mailfrom=gouders.net; dkim=pass (1024-bit key) header.d=gouders.net header.i=@gouders.net header.b=XrAFL8Ga; arc=none smtp.client-ip=202.61.206.94 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=gouders.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gouders.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=gouders.net header.i=@gouders.net header.b="XrAFL8Ga" Received: from localhost ([193.175.198.193]) (authenticated bits=0) by mx10.gouders.net (8.17.1.9/8.17.1.9) with ESMTPSA id 42JBOIRi017030 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Tue, 19 Mar 2024 12:24:19 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gouders.net; s=gnet; t=1710847459; bh=XdMD5DKc7jJ4GfF5e10B85b7q6Nt51gJ091asD8uqVk=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=XrAFL8Ga/4ZZAC3k6ML1LfOnNLh0nHZKSpednQWszRQPE8OXOOnEk6lXfyGnNqS1o Eqa+a8NHuNjE1l3AtlhJ7r6Zxsf8D+TeX8wCLWFadRbDtH4kZnt84l2g4Uhr/xGrtN dkqdLPaHn/przjP0GMlJQ1sxaDTNMiHWO3ixsoi4= From: Dirk Gouders To: git@vger.kernel.org Cc: Dirk Gouders , Junio C Hamano , Emily Shaffer Subject: [PATCH v2 4/5] MyFirstObjectWalk: fix description for counting omitted objects Date: Tue, 19 Mar 2024 12:23:14 +0100 Message-ID: <33a18458891259565e553ab39301108ce642d02f.1710840596.git.dirk@gouders.net> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Before the changes to count omitted objects, the function traverse_commit_list() was used and its call cannot be changed to pass a pointer to an oidset to record omitted objects. Fix the text to clarify that we now use another traversal function to be able to pass the pointer to the introduced oidset. Signed-off-by: Dirk Gouders --- Documentation/MyFirstObjectWalk.txt | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Documentation/MyFirstObjectWalk.txt b/Documentation/MyFirstObjectWalk.txt index a06c712e46..981dbf917b 100644 --- a/Documentation/MyFirstObjectWalk.txt +++ b/Documentation/MyFirstObjectWalk.txt @@ -754,10 +754,11 @@ points to the same tree object as its grandparent.) === Counting Omitted Objects We also have the capability to enumerate all objects which were omitted by a -filter, like with `git log --filter= --filter-print-omitted`. Asking -`traverse_commit_list_filtered()` to populate the `omitted` list means that our -object walk does not perform any better than an unfiltered object walk; all -reachable objects are walked in order to populate the list. +filter, like with `git log --filter= --filter-print-omitted`. We +can ask `traverse_commit_list_filtered()` to populate the `omitted` +list which means that our object walk does not perform any better than +an unfiltered object walk; all reachable objects are walked in order +to populate the list. First, add the `struct oidset` and related items we will use to iterate it: @@ -778,8 +779,9 @@ static void walken_object_walk( ... ---- -Modify the call to `traverse_commit_list_filtered()` to include your `omitted` -object: +You need to replace the call to `traverse_commit_list()` to +`traverse_commit_list_filtered()` to be able to pass a pointer to the +oidset defined and initialized above: ---- ... From patchwork Tue Mar 19 11:23:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dirk Gouders X-Patchwork-Id: 13596598 Received: from mx10.gouders.net (mx10.gouders.net [202.61.206.94]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0CFA654FAB for ; Tue, 19 Mar 2024 11:24:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.61.206.94 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710847474; cv=none; b=Lp4ItriANmBYWdiufVbWqbgOyFxlHsdjKsf4gwgSPUo7b1WCq5mocUhVDLXp0Vcmg3bp2qr+0tXkjyiP763GNQ0qm8kKODs+zAawNScrQFC3jB4L204Dhwkg0BCFj05n7VZ40BkfBf6y5tnrfrZo2ZWTrPmD/d0vIzYiH1rv8Hw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710847474; c=relaxed/simple; bh=ZvHqG9KyK2fn/PfbiiL0P7HCQkiSTagQKAhyGEx3gV4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Dpf311OvXfly647mjDlEeVUWXoz8wGeIb5ck/odcLC0ic3X0SfAbbEPZG8+DqhEEf/tHseZ1VAOTD3SwGPMrbkCLME+Cu9YOPC7Avf87kmUUydedFQla7ttpZEmDVWuHUgFB1oClEn3mWRDPL5kOIgVJ0KWkvOr0AZhQa+yN1FA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=gouders.net; spf=pass smtp.mailfrom=gouders.net; dkim=pass (1024-bit key) header.d=gouders.net header.i=@gouders.net header.b=X4A/9JfX; arc=none smtp.client-ip=202.61.206.94 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=gouders.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gouders.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=gouders.net header.i=@gouders.net header.b="X4A/9JfX" Received: from localhost ([193.175.198.193]) (authenticated bits=0) by mx10.gouders.net (8.17.1.9/8.17.1.9) with ESMTPSA id 42JBOO52017034 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Tue, 19 Mar 2024 12:24:24 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gouders.net; s=gnet; t=1710847464; bh=ZvHqG9KyK2fn/PfbiiL0P7HCQkiSTagQKAhyGEx3gV4=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=X4A/9JfXaaB9i4adRaDr7lwVILcVgt55mXhVUCeBjnvVziCXSMKqQKxKa8TYhzPiP w61YKbjylu+lD/oMjESFYOky5M2G1lE2Pw9Vx29EDeNvFEtJXEWyr5jFdCnyOqkls0 W0xcfmUEz6qVln5sRTOj7VTUCDAEXCBFhEGfosCI= From: Dirk Gouders To: git@vger.kernel.org Cc: Dirk Gouders , Junio C Hamano , Emily Shaffer Subject: [PATCH v2 5/5] MyFirstObjectWalk: add stderr to pipe processing Date: Tue, 19 Mar 2024 12:23:15 +0100 Message-ID: <64c36dbf16108353635a7315a3bd5eb60f2aa92e.1710840596.git.dirk@gouders.net> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 In the last chapter of this document, pipes are used in commands to filter out the first/last trace messages. But according to git(1), trace messages are sent to stderr if GIT_TRACE is set to '1', so those commands do not produce the described results. Fix this by redirecting stderr to stdout prior to the pipe operator to additionally connect stderr to stdin of the latter command. Signed-off-by: Dirk Gouders --- Documentation/MyFirstObjectWalk.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/MyFirstObjectWalk.txt b/Documentation/MyFirstObjectWalk.txt index 981dbf917b..2e6ae4d7fc 100644 --- a/Documentation/MyFirstObjectWalk.txt +++ b/Documentation/MyFirstObjectWalk.txt @@ -847,7 +847,7 @@ those lines without having to recompile. With only that change, run again (but save yourself some scrollback): ---- -$ GIT_TRACE=1 ./bin-wrappers/git walken | head -n 10 +$ GIT_TRACE=1 ./bin-wrappers/git walken 2>&1 | head -n 10 ---- Take a look at the top commit with `git show` and the object ID you printed; it @@ -875,7 +875,7 @@ of the first handful: ---- $ make -$ GIT_TRACE=1 ./bin-wrappers git walken | tail -n 10 +$ GIT_TRACE=1 ./bin-wrappers git walken 2>&1 | tail -n 10 ---- The last commit object given should have the same OID as the one we saw at the