Re: [PATCH] filter-branch: return 2 when nothing to rewrite
- From
Michele Locati <michele@locati.it>
- Date
- Mar 15, 2018, 14:57 UTC
- Message-ID
- <CAGen01iZTs1FC3tsuMF9SAS0QcKxN0Sk1CPeZ+YNyh5X8sdgtg@mail.gmail.com>
- In-Reply-To
- <20180315141220.GB27748@sigill.intra.peff.net>
2018-03-15 15:12 GMT+01:00 Jeff King <peff@peff.net>:
Show 16 quoted lines
> On Thu, Mar 15, 2018 at 02:03:59PM +0100, Michele Locati wrote: > >> Using the --state-branch option allows us to perform incremental filtering. >> This may lead to having nothing to rewrite in subsequent filtering, so we need >> a way to recognize this case. >> So, let's exit with 2 instead of 1 when this "error" occurs. > > That sounds like a good feature. It doesn't look like we use "2" for > anything else currently. > >> --- >> git-filter-branch.sh | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) > > This should probably get a mention in the manpage at > Documentation/git-filter-branch.txt, too.
Yes, I agree it would be useful. What about this addition right after the "Remap to ancestor" section?
EXIT CODE ---------
In general, this command will fail with an exit status of `1` in case of errors. When the filter can't fine anything to rewrite, the exit status is `2`.
-- Michele