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

Re: [PATCH 2/2] Add --ignore-notfound option to exit with zero status when no files are removed.

From
Steven Grimm <koreth@midwinter.com>
Date
Apr 16, 2007, 08:12 UTC
Message-ID
<46232FEE.9010907@midwinter.com>
In-Reply-To
<20070416075324.GA18961@midwinter.com>
Steven Grimm wrote:
Show 6 quoted lines
> This allows "git rm -r --ignore-notfound" to be used as an index filter
> with cg-admin-rewritehist. The documentation for that command recommends
> using git-update-index --remove to filter files out of a tree's history,
> but that doesn't support recursive deletion like git-rm does, making it
> less convenient to filter directories from history.
>   

Having said that, in some sense the problem here is arguably with cg-admin-rewritehist bailing out when a filter command exits with a nonzero status; given that git-rm is likely to be a common filter people will want to use, ideally cg-admin-rewritehist should do the right thing with git-rm's normal exit codes. But it appears Cogito is not being actively maintained any more (correct me if I'm wrong; the latest stable release is half a year old at this point, while git has changed substantially since then) so it didn't seem too worthwhile to try to patch things from that side.

I think it makes sense to be able to optionally treat a lack of matches as a non-error condition like "rm -f" does, so I'm comfortable submitting this patch regardless.

On a related note, last time I asked a question that caused someone to point me to cg-admin-rewritehist, Linus said he'd like to see its functionality folded into git proper. I have to agree with that idea; there are some obvious enhancements that program could use, and it'll be easier to do that if it's part of an actively maintained code base.

-Steve
Previous: Josef WeidendorferNext: Alex Riesen
Message 13 of 14 in “Add -q option to "git rm" to suppress output when there aren't errors.”
  1. Add -q option to "git rm" to suppress output when there aren't errors.Steven Grimm, Apr 16, 2007
  2. Junio C HamanoApr 16, 2007
  3. Steven GrimmApr 16, 2007
  4. Junio C HamanoApr 16, 2007
  5. 1/2 Add --quiet option to suppress output of "rm" commands for removed files.Steven Grimm, Apr 16, 2007
  6. 2/2 Add --ignore-notfound option to exit with zero status when no files are removed.Steven Grimm, Apr 16, 2007
  7. Junio C HamanoApr 16, 2007
  8. Steven GrimmApr 16, 2007
  9. Jeff KingApr 16, 2007
  10. Junio C HamanoApr 16, 2007
  11. Jeff KingApr 16, 2007
  12. Josef WeidendorferApr 16, 2007
  13. Steven GrimmApr 16, 2007
  14. Alex RiesenApr 16, 2007

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.