summaryrefslogtreecommitdiff
path: root/Documentation
diff options
context:
space:
mode:
authorDirk Gouders <dirk@gouders.net>2024-03-27 11:22:16 (GMT)
committerJunio C Hamano <gitster@pobox.com>2024-03-27 16:24:35 (GMT)
commit95ab557b4b6a11be693200803bbdef53117b8aa7 (patch)
treee2b8c512f1b00dd7300a0877a90370d07eb31882 /Documentation
parent7250cdb695e7a57521f0f0e8c35e7185ecbc925c (diff)
downloadgit-95ab557b4b6a11be693200803bbdef53117b8aa7.zip
git-95ab557b4b6a11be693200803bbdef53117b8aa7.tar.gz
git-95ab557b4b6a11be693200803bbdef53117b8aa7.tar.bz2
MyFirstObjectWalk: add stderr to pipe processing
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 <spectral@google.com> Signed-off-by: Dirk Gouders <dirk@gouders.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/MyFirstObjectWalk.txt4
1 files changed, 2 insertions, 2 deletions
diff --git a/Documentation/MyFirstObjectWalk.txt b/Documentation/MyFirstObjectWalk.txt
index e969a3a..dec8afe 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