From patchwork Mon Mar 25 12:33:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dirk Gouders X-Patchwork-Id: 13602206 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 E87736D1A3 for ; Mon, 25 Mar 2024 13:28:33 +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=1711373316; cv=none; b=e4A3sWsexNPQOCpZuuplFr02xgPOLaGIhI5PNl49AZF3OnXbp3pKm4m6+/LuqNR1aP9yGse0bEFII3Z00iqZvE18S+2v7u6IW6baocGHjAl1YwvwZk0o1Wb0TF6K6JVRYbNEY3rWySuqFs6rDL5rXBWu9T1gSir5rUfx81mob+A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711373316; c=relaxed/simple; bh=MNZSgGo6UitWonYONsBoyHzJ5q56OFFJdZjurv459PQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=QooIN+sAyUbB1cwTmX06ye58x2+Upt0TeHskxC+1JHbQsOSqFs2sBA4fLnk6hF85aqEl1dMEmBugTCvAVs17/zmTv/uKzaygTR4cMSwpO7g8/NDSr4k+coggX0Kv5oETfmjeWEVI8Npx+kJm1ThFYWL5vEZxVOfisL6zsp5wQZg= 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=Pb7Isk9C; 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="Pb7Isk9C" Received: from localhost (ip-109-42-177-242.web.vodafone.de [109.42.177.242]) (authenticated bits=0) by mx10.gouders.net (8.17.1.9/8.17.1.9) with ESMTPSA id 42PDJOHA003609 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Mon, 25 Mar 2024 14:19:25 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gouders.net; s=gnet; t=1711372765; bh=MNZSgGo6UitWonYONsBoyHzJ5q56OFFJdZjurv459PQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Pb7Isk9CgFOj4iBlTJBGSRbtkGnyngsL3cJM4CcrKbXpuPoJYweC7JVe6Jc5xagPC l/DgOlazZCOtIoomc2n+UTiPdly8vAxf0qRRGxQw9dbN2Rpbu4+XdUbCL9Sfc3Y1nd uVWD5zzwth9uZXnZgAs9n2Sgt3wHn5kW+ghC4m3c= From: Dirk Gouders To: git@vger.kernel.org Cc: Dirk Gouders , Junio C Hamano , Emily Shaffer , Kyle Lippincott Subject: [PATCH v3 1/5] MyFirstObjectWalk: use additional arg in config_fn_t Date: Mon, 25 Mar 2024 13:33:32 +0100 Message-ID: <0eeb4b78ac91c2bddf775fdea34ce5c0515ff205.1711368499.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 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 Mon Mar 25 12:33:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dirk Gouders X-Patchwork-Id: 13602116 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 6DF6B1741D7 for ; Mon, 25 Mar 2024 13:19:41 +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=1711372785; cv=none; b=i0JEerld8EnjNhZL8WIBXGzP75SZwJhjqMiST2SqGeKMe3d7G/DcSrqceCoXosd1e1f+JOQiD+rtV8cR/yzCCfS31epZdPL73PQJmTkQtVcSTCwmcyhP5VUI2RGMC2VL154eOKk4/0iX6HyLKIB5RcHL+7spCl+TYn/GCGPTyCs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711372785; c=relaxed/simple; bh=DubbNUQKdlz/m2hwc0qzBsOrVzz98jd57+UvAxMLqLU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=fTA00ga/hbN7P/xViiSmunbTyhOHQfm7rttnQoTTZyYCpruSh7wOIEzkaEB4n7nQ2CCy+kqnC1qLUxpWVj+DU/9lzh+FnjdlMR46P4n0MY5GkRM9K5S4DSXwGZ+F5N3OwzrUTFS5iIRnQPJSAl1v7evB7h+o9fsmjxypfu6phV8= 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=bpUoRjiM; 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="bpUoRjiM" Received: from localhost (ip-109-42-177-242.web.vodafone.de [109.42.177.242]) (authenticated bits=0) by mx10.gouders.net (8.17.1.9/8.17.1.9) with ESMTPSA id 42PDJUxv003615 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Mon, 25 Mar 2024 14:19:30 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gouders.net; s=gnet; t=1711372770; bh=DubbNUQKdlz/m2hwc0qzBsOrVzz98jd57+UvAxMLqLU=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=bpUoRjiMKrx0VV6nm06jY0cxJpAIXzUT20nTb4rkRVc0vkH/w2gu+pwekB42Hwl2c 7fUm5toyhh2upI5L9yegeIzfoifrhLRJ2YsVdxbV/CT6tYsBj0k1uJY9yq0YPwBz4r 6Xq5lR8yqFjD8VskB4KEJBBlJkbxJdukvW/01oCA= From: Dirk Gouders To: git@vger.kernel.org Cc: Dirk Gouders , Junio C Hamano , Emily Shaffer , Kyle Lippincott Subject: [PATCH v3 2/5] MyFirstObjectWalk: fix misspelled "builtins/" Date: Mon, 25 Mar 2024 13:33:33 +0100 Message-ID: <3122ae247263fb65d5900c67f7955d68de7f874c.1711368499.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 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 25 12:33:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dirk Gouders X-Patchwork-Id: 13602117 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 4DB691741D7 for ; Mon, 25 Mar 2024 13:19:47 +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=1711372791; cv=none; b=tF5zrJVu0yePUt1cXeoguoXnTGikGMGgjluh+jgyR77Md5/CV4TYWzYfQ3/OOYn0pOUIHShQVipb0IMah+Sd5+OTLF0IciDNGaWI75r183XI/TLHVvVyFSkrN8bYlQC2sjVo7DKC1mXJhkE00lzGeQZffcuk3K5/uK82VxiO0e8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711372791; c=relaxed/simple; bh=9uC3WSBZkx5lJMcx9kg2PA0EIpkw/TmOx4kpx9xQTVM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=rd9cWxuukJS40pPbNx1AUIgPQ8mRq0ODIkcDO0i/qoPI6BUpvuy/cZ2dBqiABTOUqh2e35pM1V4E1jQ8eZVK5haRL8hijzy0VREog5rwXb8zW5SmB0S/Jp9fVObdZ8uEfrmSrik+0Ay9qVF556ecnkyipMzCCO0h7AQ5NJC4cyQ= 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=Yp/BUXnN; 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="Yp/BUXnN" Received: from localhost (ip-109-42-177-242.web.vodafone.de [109.42.177.242]) (authenticated bits=0) by mx10.gouders.net (8.17.1.9/8.17.1.9) with ESMTPSA id 42PDJanL003627 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Mon, 25 Mar 2024 14:19:37 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gouders.net; s=gnet; t=1711372777; bh=9uC3WSBZkx5lJMcx9kg2PA0EIpkw/TmOx4kpx9xQTVM=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Yp/BUXnNjoszGntob2PgG/ahyzHRbR01EyUAdHsq14HVCg6KnKbyfSvfos0joh/oz sIfVpKkAQWj98yLBSAkLFoLlCPkI8d/7qSZG9sskXA2ICOJlY+vjKstZlhymVKGSWa JGW60BRATP6UaAWCQrZpJdlUXgDpIaLeJppqBt28= From: Dirk Gouders To: git@vger.kernel.org Cc: Dirk Gouders , Junio C Hamano , Emily Shaffer , Kyle Lippincott Subject: [PATCH v3 3/5] MyFirstObjectWalk: fix filtered object walk Date: Mon, 25 Mar 2024 13:33:34 +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 Mon Mar 25 12:33: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: 13602118 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 C136313B7A4 for ; Mon, 25 Mar 2024 13:19:53 +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=1711372796; cv=none; b=OnkujeNg1/OosLxbUxVSl7ccVjgj5TVx1i1zJs9pA0WQuOTpVEk8jzcHsW/FERqcp+tn+1csqjQUP+xFZCXXehXSLvFbAN9vGO65SGc73Sxas8U6s8VMcvDqTqrrb4zkKO6KonwpBscf4QRu/NPb+zfT/OduBC9W3uGv1/7xI9E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711372796; c=relaxed/simple; bh=+pdy4sDOhlD1rE+/o3W26ADVjvr5568xx7dI+Bkjbu8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=UTHTnDwE4i/Tywx9xQevJFRcKUlGnS2nWuoFDA0zwdEpG2RujCJRQ6dkHbSPN2xiySSRcNhjuMttmWPiQP+g6p7NdJW8dngPjcvebNMKKBPFe/0TBORdX6SDUO4LmN366klQxqvNj9u1i36PM1ABEvzAIyMli2fHtbd5UnDYiNI= 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=SqWzg2ap; 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="SqWzg2ap" Received: from localhost (ip-109-42-177-242.web.vodafone.de [109.42.177.242]) (authenticated bits=0) by mx10.gouders.net (8.17.1.9/8.17.1.9) with ESMTPSA id 42PDJgLX003638 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Mon, 25 Mar 2024 14:19:42 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gouders.net; s=gnet; t=1711372783; bh=+pdy4sDOhlD1rE+/o3W26ADVjvr5568xx7dI+Bkjbu8=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=SqWzg2apubpKgHHJJFk6igQbBzrRmAczqvq2NVbGUT5JtWoB7mdw/NZ8/blUxbJXT Q+eIebx6bmhH8xHNVC3qXaYM7+hVm2097kyLQ9SAooBXNtNEPlexK+53BA08nLBIOB n/c702f8CFNetmDgM74LespZ2kLUgEuO6MDY5Tng= From: Dirk Gouders To: git@vger.kernel.org Cc: Dirk Gouders , Junio C Hamano , Emily Shaffer , Kyle Lippincott Subject: [PATCH v3 4/5] MyFirstObjectWalk: fix description for counting omitted objects Date: Mon, 25 Mar 2024 13:33:35 +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 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 | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Documentation/MyFirstObjectWalk.txt b/Documentation/MyFirstObjectWalk.txt index a06c712e46..811175837c 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`. To do this, +change `traverse_commit_list()` to `traverse_commit_list_filtered()`, which is +able to populate an `omitted` list. Note that this means that our object walk +will 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: +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 Mon Mar 25 12:33:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dirk Gouders X-Patchwork-Id: 13602119 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 3629B174970 for ; Mon, 25 Mar 2024 13:19:58 +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=1711372801; cv=none; b=cWQaLoBq9GtbvzCaByWPHLyiijkG1HfAIa+EqeOPiWFTU12yCFjDCtR4km7SSu5T2Iah//V1I4lvo+L5KKxWdHt6jKcA6Yh3eDHl7Tjh6KjK4hc188VHq+2jXTnsS0HeLWkEiegi48jKKuoJ4q0JLvkj+oYiYyv0Q6cZuJF1oOs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711372801; c=relaxed/simple; bh=LhrhyYN2aG5AX2pcBpKXUA5jSGvny8BN3UUFZR8c9oY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=NXMMfUx7/7ADnsPoqnebWLj1Z3eZkXkg+zQ/ENmbUXq10psDPYvWiNVLsW/i2Kii/NxI+7JoOzYAO/tOeVidkVB7QNHzT8B09ufq1VbuSbM+E+cK4tuAbFbVJtcYnDAgB6VRR/LxQ5R7kdc41GG8dsVlp2MiXGxv+jSldB6bzxE= 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=GVQIDvfO; 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="GVQIDvfO" Received: from localhost (ip-109-42-177-242.web.vodafone.de [109.42.177.242]) (authenticated bits=0) by mx10.gouders.net (8.17.1.9/8.17.1.9) with ESMTPSA id 42PDJmCx003647 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Mon, 25 Mar 2024 14:19:49 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gouders.net; s=gnet; t=1711372789; bh=LhrhyYN2aG5AX2pcBpKXUA5jSGvny8BN3UUFZR8c9oY=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=GVQIDvfOnQUq5UiOMAwnGwvGGKQedywBEEhs0IY6DW2CFGYS3C5P6ht7XgY17plEn G92Jmu858Y8F8YwvQZ3QsSx9yVJiTnE5Oka1QuPcKDWZG/vQh90rs/MAxXgAG8bpPM ccfDt1GBvU4UZUF5Gm/2vVyOrVccncdaheQOqshU= From: Dirk Gouders To: git@vger.kernel.org Cc: Dirk Gouders , Junio C Hamano , Emily Shaffer , Kyle Lippincott Subject: [PATCH v3 5/5] MyFirstObjectWalk: add stderr to pipe processing Date: Mon, 25 Mar 2024 13:33:36 +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 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 811175837c..3d78403c4a 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