From patchwork Mon Mar 11 10:11: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: 13589333 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 0F19256B6A for ; Mon, 11 Mar 2024 21:44:43 +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=1710193486; cv=none; b=fZrL5Eoazf38t1KMu9W4Kb936ozXi3POBnpuvqCRjGrDKgasmXYKjjUMT7yd4JNC+jdfGx+d7xYTygtGcJaKw0mSR8HEkQnnjUbGU//FVwYlZ9CDCm+N+oaq9qQlvihiYOjAIoB6tAOzJnRX5KN2Dw9whpx69JEntH2IJ/FaEFo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710193486; c=relaxed/simple; bh=we4uyQZ6kvJ5QQsS3BkDzuy1zXqa9AZS2V4Hqpzn7tk=; h=From:To:Cc:Subject:In-Reply-To:Date:Message-ID:References: MIME-Version:Content-Type; b=mE7R+eJAAawisCNO6K1nHiwtURJcIz0AoyIGKifnpmKbh93dTbDcMpNLNwmBMI737zDA23urD81tk2Cj5vL3d5Fc3g1vCpbqVJZSIK2BONNLq1cdsYOPO5oTMs9BvMjfpSierrMqNxPe3sLEpcX9zj1sRWVR+/nC6LvHQybEUig= 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=mEQWswkE; 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="mEQWswkE" Received: from localhost (ip-109-42-178-223.web.vodafone.de [109.42.178.223]) (authenticated bits=0) by mx10.gouders.net (8.17.1.9/8.17.1.9) with ESMTPSA id 42BLieA2032023 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Mon, 11 Mar 2024 22:44:40 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gouders.net; s=gnet; t=1710193480; bh=we4uyQZ6kvJ5QQsS3BkDzuy1zXqa9AZS2V4Hqpzn7tk=; h=From:To:Cc:Subject:In-Reply-To:Date:References; b=mEQWswkEf5k3KHGaSIKRdvboFhD6KPkfHsXWRSbViuPTdUiUtF/Udahe0bAvkA/Tc +NlzvT4JcXLAxNv7VHGG+PDJl+ArxOheE8l9pn22angmOvm6VfUSj7ZZYv/B0WDY5p moA+oRyj0oqLnztdnqvkntJ8sl1UFd6ECODOgbeI= From: Dirk Gouders To: git@vger.kernel.org Cc: Glen Choo Subject: [PATCH 1/5] MyFirstObjectWalk: use additional arg in config_fn_t In-Reply-To: Date: Mon, 11 Mar 2024 11:11:11 +0100 Message-ID: <15b74566e07a39902556cd620e5cd6df1da3c7df.1710192973.git.dirk@gouders.net> 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. Fixes: a4e7e317 (config: add ctx arg to config_fn_t) Cc: Glen Choo 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 Mon Mar 11 10:26:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dirk Gouders X-Patchwork-Id: 13589334 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 E3A041CD3A for ; Mon, 11 Mar 2024 21:45: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=1710193534; cv=none; b=C/MhlhEjLgKc0MJmFkCgS87uTDQUq96L8CHjWHtygxTKoq0r1ZsvWq9CDdgqH/tPvWTTSfZKoopLcuHcfeUVz6ER6hzYStWQj1yTB9osbShDPopZBA8EFgVsGHrinHivMUMuJkxRBUYqYuUiDa5fF0L6SmFWEwe3f8vpu4nKpfM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710193534; c=relaxed/simple; bh=DubbNUQKdlz/m2hwc0qzBsOrVzz98jd57+UvAxMLqLU=; h=From:To:Subject:In-Reply-To:Date:Message-ID:References: MIME-Version:Content-Type; b=inFytNFfvyI+etg0+MUTKrjUFzoSj7Tr8vw4d5ZpUJN8LbmcUl5/Lg8HVXgg9Bbz4do0SjuLHOZWg5rGk9SVxRyJUcOvyRnb2bznq86+QR6SW9OR0GjAxh/hBH/Cnop1GcMuoe2/ZIHI7KuKYdhwIN3p0xHNd4ewxjs8cx7Vc8k= 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=VqJINhqA; 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="VqJINhqA" Received: from localhost (ip-109-42-178-223.web.vodafone.de [109.42.178.223]) (authenticated bits=0) by mx10.gouders.net (8.17.1.9/8.17.1.9) with ESMTPSA id 42BLjTsH032067 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO) for ; Mon, 11 Mar 2024 22:45:29 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gouders.net; s=gnet; t=1710193529; bh=DubbNUQKdlz/m2hwc0qzBsOrVzz98jd57+UvAxMLqLU=; h=From:To:Subject:In-Reply-To:Date:References; b=VqJINhqAaXyvR57yS7iP1iRUA/27yIwHC117K4Zq5aBdSlmj2Px8IHqaHmodPx1nH iG7FZsxKOP0VIRTDhbeLwBVUxJkAhuPkyzCO89+LAp6HUhpiVZin3ABH0M5CO4l+xq X/Lw7yx+tvwRi4kndXnjGSvLz5AeD+N1oBp5dTcA= From: Dirk Gouders To: git@vger.kernel.org Subject: [PATCH 2/5] MyFirstObjectWalk: fix misspelled "builtins/" In-Reply-To: Date: Mon, 11 Mar 2024 11:26:35 +0100 Message-ID: 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 Mon Mar 11 12:47:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dirk Gouders X-Patchwork-Id: 13589335 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 6586F1CD3A for ; Mon, 11 Mar 2024 21:46: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=1710193576; cv=none; b=izSxMgxi+P8Q0vJzfuAKwarEFN4mm2h0JryavJje7WVh+Qr8jBMFbwrxCE2R8ANGMyNH4aot1oC87djM9wFolBjfVMKVODGaF1PHuAWHA651D4rcg/xJ4911/jYfEtmo91IcO6z7F+fVGUScROUeEhGpXcwnzJEc6KWKPMj78Dk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710193576; c=relaxed/simple; bh=W6lIdyhAdxlbKs7A6d+V+K9C0i4ZMNxkIms7JoQ1mpg=; h=From:To:Cc:Subject:In-Reply-To:Date:Message-ID:References: MIME-Version:Content-Type; b=TVVoXHLU3IqzMIkrUrLizSJ5qd8vXFfL02b9oHP31YjKCb2Sw2VXoprAxGfsgNZvDy3SYJ5i+dQT4yf94XPmPt0dCCaF3xM/FQsNql/bGhHcZT/lq+PcjVhxFTeDNnokAS1442NTpuwm0W1GiMZakxVcfCaiL2Arw+D5/D1myMQ= 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=JU+/Rkcu; 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="JU+/Rkcu" Received: from localhost (ip-109-42-178-223.web.vodafone.de [109.42.178.223]) (authenticated bits=0) by mx10.gouders.net (8.17.1.9/8.17.1.9) with ESMTPSA id 42BLkBd2032120 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Mon, 11 Mar 2024 22:46:12 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gouders.net; s=gnet; t=1710193572; bh=W6lIdyhAdxlbKs7A6d+V+K9C0i4ZMNxkIms7JoQ1mpg=; h=From:To:Cc:Subject:In-Reply-To:Date:References; b=JU+/RkcuGYV4wnP5gAURsMn1WrueuVbnDeDM7lgE8zbOjGygwkXiZf+nuMAc0pNGb Stb/XYVuz2puddSGQPI0/CA3I7ZbzVsgiArxSID+Yd7CsXP0KSrYKMmtpiuZvVAGAT qzNLUQJtjDSKlgV9WsvWB2b120aeNeIe6eHGFc9k= From: Dirk Gouders To: git@vger.kernel.org Cc: Derrick Stolee Subject: [PATCH 3/5] MyFirstObjectWalk: fix filtered object walk In-Reply-To: Date: Mon, 11 Mar 2024 13:47:24 +0100 Message-ID: <0f67a161efc2635bb453eff2f6ab34b94c8794ae.1710192973.git.dirk@gouders.net> 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. Fixes: f0d2f849 (MyFirstObjectWalk: update recommended usage) Cc: Derrick Stolee 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 Mon Mar 11 13:29:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dirk Gouders X-Patchwork-Id: 13589337 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 EFEA456B6A for ; Mon, 11 Mar 2024 21:46:57 +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=1710193620; cv=none; b=trSphzG/yVN1Uso2fybEdqSOeNM9dnt6JXrnFcAB6WbH0Wob98UxnD/XPcmBQx5ss30G9qKJdxdKEVakBTVk8xwrLd0w4tswUC92P6OZQQiigjHi+1/ocDJl7X8HrJk/1XAa4SpNvWIhqWT0AvNU+UvM6677I0qD0/aX9USuomo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710193620; c=relaxed/simple; bh=XdMD5DKc7jJ4GfF5e10B85b7q6Nt51gJ091asD8uqVk=; h=From:To:Subject:In-Reply-To:Date:Message-ID:References: MIME-Version:Content-Type; b=Na6C2/SRswodU0l748SU+AdpYUqfMRZRpeqHaSAVVzux5zaOIQi2WpWuDustXV3IYR1hEDLU9I2ekXvKYuaya8PDitoZJJRPDyrJY7A7Vr+uV5UGP6uEDGHKQ4+5jATl15ZnKywajKbWyHsvaBEzwMiQtevff5f9dniuTOZMZh0= 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=m3mPYbbP; 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="m3mPYbbP" Received: from localhost (ip-109-42-178-223.web.vodafone.de [109.42.178.223]) (authenticated bits=0) by mx10.gouders.net (8.17.1.9/8.17.1.9) with ESMTPSA id 42BLks9J032159 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO) for ; Mon, 11 Mar 2024 22:46:55 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gouders.net; s=gnet; t=1710193615; bh=XdMD5DKc7jJ4GfF5e10B85b7q6Nt51gJ091asD8uqVk=; h=From:To:Subject:In-Reply-To:Date:References; b=m3mPYbbPu820KRXamW3SrM05tSlol1TsG4JgMYr3rhghqwaHQhQOatmHquFsm+pgx 5wqjucK9EbwU7NIVJZVcFyKifgtsod2tvvI8nTKHBaNuuwdOqANNuVf9skTay2Y2Eu n3mznGf96ae+awc0F90UvdehpEt5ZLVwvOIYScIg= From: Dirk Gouders To: git@vger.kernel.org Subject: [PATCH 4/5] MyFirstObjectWalk: fix description for counting omitted objects In-Reply-To: Date: Mon, 11 Mar 2024 14:29:24 +0100 Message-ID: <637070dd48ceefc5c2b7a902dd5eb3ecde503894.1710192973.git.dirk@gouders.net> 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 Mon Mar 11 21:00: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: 13589338 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 504C756B6A for ; Mon, 11 Mar 2024 21:47:39 +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=1710193661; cv=none; b=MLMqLZ2r9AUq+vUwA7Xl6f6zKB2GHE+w+qxzbFM2aCE3MFnvBsf/DuSMxH14AYpxPH/ngjdRO+RSIBzgXukg4ofV9M4cAnU6gdKOBSTYkUZGmBkx+ujQKq1B2rFbobUGxLi6/O5hGEL+WJgw9GMvX9S4RHz8nDvmD0Fvu7AZXAY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710193661; c=relaxed/simple; bh=xEYWllW8G7d5UN1yoUMjwr/zGo8fXarZt4ba3/BxP+0=; h=From:To:Subject:In-Reply-To:Date:Message-ID:References: MIME-Version:Content-Type; b=EdkKSF2CaN7MLVw88Vk1zHtm7/MRyU7iT73GIMgD8rTnrIJteckmW+UUgbODdruafZK1VtGw6NpgKIkCHwARww+7GaDS+G2zyXE7j+p90b5+6iOZJpaL7M2ZDx2HRHjvvmyz+1TCM62ZikNKu8JHEQFipbZQlmnpwKsWz+/cTuU= 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=O5Ca48Yk; 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="O5Ca48Yk" Received: from localhost (ip-109-42-178-223.web.vodafone.de [109.42.178.223]) (authenticated bits=0) by mx10.gouders.net (8.17.1.9/8.17.1.9) with ESMTPSA id 42BLlarV032209 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO) for ; Mon, 11 Mar 2024 22:47:37 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gouders.net; s=gnet; t=1710193657; bh=xEYWllW8G7d5UN1yoUMjwr/zGo8fXarZt4ba3/BxP+0=; h=From:To:Subject:In-Reply-To:Date:References; b=O5Ca48YkO3H+nhVxSlSESdIscNGukqH8Rr4OJfp4KIVkdEk0232fsgFiTt0vuR6ET 2IoZlkmloWIBKJrzHYV7MkXUxGc/Ei5+rEi62wzCmiclwQVFS8KNwjjGpq9bPFVdqj Lnk4YnGU+WL2u7NB1KLkRwvJ3MQ/3Rsb+pxeuSgM= From: Dirk Gouders To: git@vger.kernel.org Subject: [PATCH 5/5] MyFirstObjectWalk: add stderr to pipe processing In-Reply-To: Date: Mon, 11 Mar 2024 22:00:12 +0100 Message-ID: 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 using the 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..b96724c4d7 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 |& 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 |& tail -n 10 ---- The last commit object given should have the same OID as the one we saw at the