Re: problems GIT_TRACE
- From
Junio C Hamano <junkio@cox.net>
- Date
- Jul 10, 2006, 12:22 UTC
- Message-ID
- <7vwtalbqeo.fsf@assigned-by-dhcp.cox.net>
- In-Reply-To
- <E1Fzta3-00066Z-8B@moooo.ath.cx>
Matthias Lederhofer <matled@gmx.net> writes:
Show 13 quoted lines
> I just discovered a problem with GIT_TRACE. Some scripts redirect > stderr to stdout and the trace messages go with it. For example from > git-repack: >> name=$(git-rev-list --objects --all $rev_list 2>&1 | >> git-pack-objects --non-empty $pack_objects .tmp-pack) || >> exit 1 > Then for example git-pack-objects complains: >> fatal: expected sha1, got garbage: >> trace: built-in: git 'rev-list' '--objects' '--all' > git-grep '2>&' shows a few other places that do this too, I'll take a > closer look at this later. Is there any reason to redirect stderr to > stdout? I think this will always fail with such a strange error > message when something is written to stderr.
This particular one is trying to catch an error condition from rev-list. Shell reports the exit status from the last command in the pipeline, and when rev-list notices a corrupt repository, it wants to tell pack-objects to stop producing incorrect pack, but there is no way other than sending a garbage string (as an error message) to cause pack-object to notice there is garbage coming in.