Re: [PATCH 3/2] git-merge-cache -q doesn't complain about failing merge program
- From
Junio C Hamano <junkio@cox.net>
- Date
- Jul 30, 2005, 02:11 UTC
- Message-ID
- <7vack582ly.fsf@assigned-by-dhcp.cox.net>
- In-Reply-To
- <20050729125338.GB21909@pasky.ji.cz>
Petr Baudis <pasky@suse.cz> writes:
> git-merge-cache reporting failed merge program is undesirable for > Cogito, since it emits its own more appropriate error message in that > case. However, I want to show other possible git-merge-cache error > messages. So -q will just silence this particular error.
That description makes it sound more like it is a Cogito specific hack, which other Porcelains may not benefit from, meaning they may want to suppress some other errors but this patch does not give that possibility.
I do not mind about the above too much, but I'll sit on this one for now just in case if anybody comes up with a different patch to give a bit cleaner solution.
I wonder how many die()'s we have in our C code. It _might_ be cleaner to say (the first parameter being exit(2) parameter):
die("unable to execute '%s'", pgm);
die_with(47, "merge program failed");and have the calling Porcelain, if it wants to, supress error messages by redirecting 2>/dev/null, and say whatever it wants to say based on $?.