git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] filter-branch: return 2 when nothing to rewrite

From
Jeff King <peff@peff.net>
Date
Mar 15, 2018, 15:35 UTC
Message-ID
<20180315153525.GA29265@sigill.intra.peff.net>
In-Reply-To
<CAGen01iZTs1FC3tsuMF9SAS0QcKxN0Sk1CPeZ+YNyh5X8sdgtg@mail.gmail.com>
On Thu, Mar 15, 2018 at 03:57:15PM +0100, Michele Locati wrote:
Show 11 quoted lines
> >>  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
> ---------

That seems like a good place (for those just reading on the list, it's right before the "examples" section).

It looks like we don't have many similar sections, but when we do we call them "EXIT STATUS" (which seems to match other projects like "grep").

> 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`.
s/fine/find/

Do we want to commit to status `1` for everything else? Most of the C code that dies does so with 128, and I wonder if that could propagate in some cases. IOW, could we leave room for that and for future changes with something like:

  On success, the exit status is `0`.  If the filter can't find any
  commits to rewrite, the exit status is `2`. On any other error,
  the exit status may be any other non-zero value.
-Peff
PS I think this is your first patch to Git. I forgot to say: welcome to
   the list!
Previous: Michele LocatiNext: Junio C Hamano
Message 4 of 12 in “filter-branch: return 2 when nothing to rewrite”
  1. filter-branch: return 2 when nothing to rewriteMichele Locati, Mar 15, 2018
  2. Jeff KingMar 15, 2018
  3. Michele LocatiMar 15, 2018
  4. Jeff KingMar 15, 2018
  5. Junio C HamanoMar 15, 2018
  6. Jeff KingMar 15, 2018
  7. Junio C HamanoMar 15, 2018
  8. Michele LocatiMar 15, 2018
  9. Jeff KingMar 15, 2018
  10. filter-branch: return 2 when nothing to rewriteMichele Locati, Mar 15, 2018
  11. Junio C HamanoMar 15, 2018
  12. Jeff KingMar 15, 2018

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.