From patchwork Wed Mar 27 11:22: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: 13606261 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 42FF547F54 for ; Wed, 27 Mar 2024 11:22:56 +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=1711538579; cv=none; b=cQ3v7bAg4K167nxJ+JRWoyJ+DUKMibkBQ17eJg79TB2v29TQ7QS6PRiDkdShgpQxkszGolEziTqMkYDMnwuTpXoaXepvipjVS74pb79OE/K3Ns72Gi0/33Dikhf9QFjqgakkV/zr8bU/BHNlbOZp1AEjheVtezaljFJBbHLFG1w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711538579; c=relaxed/simple; bh=CpRomrezvQDUn43nIevebbmkF0ukq3h9qTDfjfXBaa4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Wr8OYPar6g6/DipIIt9zUCHeVnHRngG+/Z7kckiD8ajXyM6ss1hUSHWiQ/nJ86g4qR/P8jSC34IbiYevXh7uNaNMxauPyqWNmgVJWNxJqNVMa/vCPpZKqngdmsqj+wbgLygT72Cnci/G5t2tAenlPO2gnoPIJ4BvOPu7oz9lEPQ= 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=CfPepBhF; 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="CfPepBhF" 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 42RBMlD0003288 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Wed, 27 Mar 2024 12:22:47 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gouders.net; s=gnet; t=1711538567; bh=CpRomrezvQDUn43nIevebbmkF0ukq3h9qTDfjfXBaa4=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=CfPepBhFRkipYTWK7rMXVE5LjGdThQzxYmVxRLe8zPZ8jWuEP0MBJav+tWimzz8+c /WZrWpFlklgDynD2fdyI6B4gTg+QyVmefZhiZWkaxv9Nc9oSPAJqQHPJCSbqikfZJ5 nBWZsjzbyV1C2OqUVn+xqyyybvKoMAa+P94ubb5I= From: Dirk Gouders To: git@vger.kernel.org Cc: Dirk Gouders , Junio C Hamano , Emily Shaffer , Kyle Lippincott Subject: [PATCH v5 1/5] MyFirstObjectWalk: use additional arg in config_fn_t Date: Wed, 27 Mar 2024 12:22:12 +0100 Message-ID: <292ae6754843c2d400dd54fb162f71642b73c8f1.1711537370.git.dirk@gouders.net> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: <20240326130902.7111-1-dirk@gouders.net> Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Commit a4e7e317f8 (config: add ctx arg to config_fn_t, 2023-06-28) 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 Wed Mar 27 11:22: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: 13606262 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 6EA4947F54 for ; Wed, 27 Mar 2024 11:23:02 +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=1711538585; cv=none; b=MDMrCTefL8zAs66eMPhLaZfnEe/JPt9C5dSi9j3vtpl6Eoj7r1EE24xeE+vl8+wDEq1iCjAFAibwAhUEG5+LBetSStjipgZYU9bFmStATm9EFAvee3HASy9pwCgCvwq8xXyyUL/ItPqA//sDInNHGUJ4+rJleChXU1tyuOXhEKg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711538585; c=relaxed/simple; bh=DubbNUQKdlz/m2hwc0qzBsOrVzz98jd57+UvAxMLqLU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=UbFdocGLp7z8XXgBEM7Z6WvqoYR6ZWEXtHm7EooLpCBoVu+YQDIj2Dzr6TVews7PtoRvp5xhoTvaYoGlUmRGlFtv2vyB5j2QeDN2sajAOtBabAkPg9v568B6fMccw7iUSyE/f/Q8RpdtiYbh1LMJc130Azde0WNnGyL8RTblMvU= 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=hr8QkW4c; 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="hr8QkW4c" 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 42RBMqNr003299 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Wed, 27 Mar 2024 12:22:52 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gouders.net; s=gnet; t=1711538572; bh=DubbNUQKdlz/m2hwc0qzBsOrVzz98jd57+UvAxMLqLU=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=hr8QkW4c2nRxY8BwXTcxppdXzzK6/s+5avCVB/X0G/2BMskTExCIdHMSmu2HtO8oA 6mm8DyBxtsCuFxrzzohByZtyOTSTexua1uM8CmXgrZzH7poaS80AlKz/QVYI5Hkxgr 5dRAqZWUlTg8lcy67M/fh6cdC4p8X5QogZ2LiGJI= From: Dirk Gouders To: git@vger.kernel.org Cc: Dirk Gouders , Junio C Hamano , Emily Shaffer , Kyle Lippincott Subject: [PATCH v5 2/5] MyFirstObjectWalk: fix misspelled "builtins/" Date: Wed, 27 Mar 2024 12:22:13 +0100 Message-ID: <99284db8c18b4b53765126e04f6f7248058ac1b4.1711537370.git.dirk@gouders.net> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: <20240326130902.7111-1-dirk@gouders.net> 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 Wed Mar 27 11:22: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: 13606263 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 2A7384F1FB for ; Wed, 27 Mar 2024 11:23:08 +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=1711538591; cv=none; b=R28berKyPqgJDMSHD44ij6VNrIwZAmuFEeUOPwOvT6u357knX0F0rT0w86tUTj9VhLIxwPmjuAB7zqK2eYrkb72B1H9MEJurvnwDlmalAuou1rn6BXCrloa8hovdTb1OJz9/0btjyV6Fqes4aPGja3GzsjYdsgHf6tIWpFZm7Gk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711538591; c=relaxed/simple; bh=wHBJ8IdYC9WwCmpz9ocMUeSzzlacf3sM7gPGp/X+I4Y=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=k3bgNEudvHV1onG0vYpvIR+DFVQ4zn+wU4Hqbsxit0wZrCHNdqYljDpqkV2UoHqFm7evib3gM7NTd2HC1xhVC176i1gDZFCHuT25JTbjkuX7pdZX7cVRM6/Vy8mzKIVI/yVi80v/G7czVQkO8lMAiGHlLYGvJQWBJ2nUZ6pYiso= 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=QXjGiucE; 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="QXjGiucE" 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 42RBMvXF003308 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Wed, 27 Mar 2024 12:22:58 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gouders.net; s=gnet; t=1711538578; bh=wHBJ8IdYC9WwCmpz9ocMUeSzzlacf3sM7gPGp/X+I4Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=QXjGiucEc4RjK+642fQduyZjFq6Aug2pb3eBePrNVRkUJb+qXNptSfHEhVQ0heVoI 9bCKjt9R+sBfkbk3kIx25xsLhentVQRahWiR5r7BPkuhRa3hptzkagtunzpgVQ/ujw QlOGjHe/JyIoXvI+mAFfykpRGvNLFXyglsF6lcDI= From: Dirk Gouders To: git@vger.kernel.org Cc: Dirk Gouders , Junio C Hamano , Emily Shaffer , Kyle Lippincott Subject: [PATCH v5 3/5] MyFirstObjectWalk: fix filtered object walk Date: Wed, 27 Mar 2024 12:22:14 +0100 Message-ID: X-Mailer: git-send-email 2.43.0 In-Reply-To: References: <20240326130902.7111-1-dirk@gouders.net> Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Commit f0d2f84919 (MyFirstObjectWalk: update recommended usage, 2022-03-09) 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 Wed Mar 27 11:22: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: 13606264 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 AB1FB4F1FB for ; Wed, 27 Mar 2024 11:23:13 +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=1711538595; cv=none; b=nQ0Do8wG2IYkjEda+aHfmSlYY8/0NkjUyPu8zztAv4hobX67h7pm7TD+cqwAT1WOurlXZcuOaqHXLNDMRwwQOS3R3Uq6Dgo8Vp0bZMtbcZ0u3aWnoNDBymWimLzGox9deK3RXVwfzQvvOCsklVsz5OG9ZgTtMGgieylHHXS7bNE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711538595; c=relaxed/simple; bh=gec2sNstkboCxx2/BhYtIebS0mK+21ErEFXRShlJo1A=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=WIW6zjD6DSlilqq1Ax4eEHmQQ1Q3VRiwUjrN6JpkrAOEuoQa9HQix6wp6P2LY9R+Vv6KdAzCtm9qz9Ma4DmkqOKh6A7OFKgD+HPeu1PFGUVJUT+1KwyGQwLg+oso/4gO73yKBQ3tP+G/oWoYgtvD3oN25rrDfpE5494NQI3wpsk= 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=t4GGkkjU; 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="t4GGkkjU" 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 42RBN3W7003317 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Wed, 27 Mar 2024 12:23:03 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gouders.net; s=gnet; t=1711538583; bh=gec2sNstkboCxx2/BhYtIebS0mK+21ErEFXRShlJo1A=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=t4GGkkjUsldpKVAR//zjjmExCfwO0fkiLhM1HX2WRb4hx3QXzZf50zp6np7wP6MQo g+rcJYMyvWkkKW/+qZbQCKw2QiEG+OMbFExLg8KUZa7hSWM11kOcIpD8RVIHeAFNEi zVV0hcwbJvoGz/asuT+RgcIf92E5jyydno1MAcbk= From: Dirk Gouders To: git@vger.kernel.org Cc: Dirk Gouders , Junio C Hamano , Emily Shaffer , Kyle Lippincott Subject: [PATCH v5 4/5] MyFirstObjectWalk: fix description for counting omitted objects Date: Wed, 27 Mar 2024 12:22:15 +0100 Message-ID: X-Mailer: git-send-email 2.43.0 In-Reply-To: References: <20240326130902.7111-1-dirk@gouders.net> 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. Helped-by: Kyle Lippincott Signed-off-by: Dirk Gouders --- Documentation/MyFirstObjectWalk.txt | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/Documentation/MyFirstObjectWalk.txt b/Documentation/MyFirstObjectWalk.txt index a06c712e46..e969a3a68a 100644 --- a/Documentation/MyFirstObjectWalk.txt +++ b/Documentation/MyFirstObjectWalk.txt @@ -754,10 +754,12 @@ 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`. To do this, +change `traverse_commit_list()` to `traverse_commit_list_filtered()`, which is +able to populate an `omitted` list. Asking for this list of filtered objects +may cause performance degradations, however, because in this case, despite +filtering objects, the possibly much larger set of all reachable objects must +be processed in order to populate that list. First, add the `struct oidset` and related items we will use to iterate it: @@ -778,8 +780,9 @@ static void walken_object_walk( ... ---- -Modify the call to `traverse_commit_list_filtered()` to include your `omitted` -object: +Replace the call to `traverse_commit_list()` with +`traverse_commit_list_filtered()` and pass a pointer to the `omitted` oidset +defined and initialized above: ---- ... From patchwork Wed Mar 27 11:22:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dirk Gouders X-Patchwork-Id: 13606265 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 936535EE64 for ; Wed, 27 Mar 2024 11:23:16 +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=1711538598; cv=none; b=ZZpdGvaTWxbZ6+WuNx+k01ZEXCj5hrEK/KZUFPuPXFnxErrx61MeVJvqMigPtGBt5OLdEzvhcHU7qvFo9ymZeFqSn+C8sQ/BJ8+N6yijb1FbQCYzNpyFEB3Hi7Cc2Sal6u7C/B7PPN9o4/mAeh/nuC3gWiY17bZzFpta5dXDOQ4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711538598; c=relaxed/simple; bh=f4Djj4f0AJMe22bSDVodPVpgugRTrnmC7VVyAz7RBqw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=sAlNwa2xYatJBiQ4JJ+YgWyyrkr/2ChnXBS1oVwXy3oPVVqy5gzAIeHppoV9B39y8ThGQVzwQXRCuoYr/WMTjFkg4xpPtT+e2lRy/2/hPLht9cXj0/FVo31+qfky1Yib+0GXSVYJ9yW/lZrl4eHwoDDmjbzM6owR6dp4eSobM3A= 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=SO/e6cCX; 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="SO/e6cCX" 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 42RBN8Zj003326 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Wed, 27 Mar 2024 12:23:08 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gouders.net; s=gnet; t=1711538588; bh=f4Djj4f0AJMe22bSDVodPVpgugRTrnmC7VVyAz7RBqw=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=SO/e6cCXfvzyU19Lgm3QAwSD40UTpRFzIe9AVh/IxFQFBUv0m3O1vJeVRONsEluCn rU9B2sxtQfglYUKpPlLpMYtVITvkcrUrg4Xb+ZC41W52pCvmekElWDKGkSO86YI2EO Bzh7Icjz9rpvUDMV5vKiZOM+OAxlVzopTAQnL7OE= From: Dirk Gouders To: git@vger.kernel.org Cc: Dirk Gouders , Junio C Hamano , Emily Shaffer , Kyle Lippincott Subject: [PATCH v5 5/5] MyFirstObjectWalk: add stderr to pipe processing Date: Wed, 27 Mar 2024 12:22:16 +0100 Message-ID: <0a3dbd14525ba9784ed8d5c329e757d5068e8b36.1711537370.git.dirk@gouders.net> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: <20240326130902.7111-1-dirk@gouders.net> 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. Further, while reviewing the above fix, Kyle Lippincott noticed a second issue with the second of the examples: a missing slash in the executable path "./bin-wrappers git". Add the missing slash. Helped-by: Kyle Lippincott 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 e969a3a68a..dec8afe5b1 100644 --- a/Documentation/MyFirstObjectWalk.txt +++ b/Documentation/MyFirstObjectWalk.txt @@ -848,7 +848,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 @@ -876,7 +876,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