Skip to content

Commit 95ab557

Browse files
dgoudersgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Dirk Gouders <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 7250cdb commit 95ab557

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Documentation/MyFirstObjectWalk.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -848,7 +848,7 @@ those lines without having to recompile.
848848
With only that change, run again (but save yourself some scrollback):
849849

850850
----
851-
$ GIT_TRACE=1 ./bin-wrappers/git walken | head -n 10
851+
$ GIT_TRACE=1 ./bin-wrappers/git walken 2>&1 | head -n 10
852852
----
853853

854854
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:
876876

877877
----
878878
$ make
879-
$ GIT_TRACE=1 ./bin-wrappers git walken | tail -n 10
879+
$ GIT_TRACE=1 ./bin-wrappers/git walken 2>&1 | tail -n 10
880880
----
881881

882882
The last commit object given should have the same OID as the one we saw at the

0 commit comments

Comments
 (0)