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

Re: [PATCH 1/5] port --ignore-unmatch to "git add"

From
Nanako Shiraishi <nanako3@lavabit.com>
Date
Aug 14, 2009, 21:39 UTC
Message-ID
<20090815063958.6117@nanako3.lavabit.com>
In-Reply-To
<200908141539.18087.luke@dashjr.org>
Quoting "Luke-Jr" <luke@dashjr.org>
Show 23 quoted lines
> On Friday 14 August 2009 02:52:33 pm Junio C Hamano wrote:
>> Thomas Rast <trast@student.ethz.ch> writes:
>> > Junio C Hamano wrote:
>> >> Chould you refresh my memory a bit?
>> >>
>> >> In what circumstance is "rm --ignore-unmatch" useful to begin with?
>> >
>> > Not sure about add --ignore-unmatch myself, but there's even an
>> > example of rm --ignore-unmatch in man git-filter-branch, along the
>> > lines of
>> >
>> >   git filter-branch --index-filter '
>> >     rm --ignore-unmach some_file_that_shouldnt_be_in_history
>> >   ' -- --all
>>
>> Ah, that makes sense.  I am not sure about "add --ignore-unmatch" myself
>> either, and an example similar to the above filter-branch would not apply
>> very easily (i.e. "add a file that should have been in history" would not
>> need --ignore-unmatch).
>
> The purpose of "add --ignore-unmatch" is to ignore race conditions where one 
> of the files to be added has been deleted after git is executed, but before 
> git scans it.
First of all, it should have been mentioned as part of your proposed commit log message.
Second of all, if a race condition makes an "add" fail, isn't it a good thing? If your "add" ignored such a failure, you'd be recording an inconsistent or incomplete state.
IMHO, fixing your racy script is a much cleaner solution to your problem than forcing "git add" to ignore errors.
-- 
Nanako Shiraishi
http://ivory.ap.teacup.com/nanako3/
Previous: Luke-JrNext: Luke-Jr
Message 19 of 21 in “For review: git add --ignore-unmatch”
  1. Luke-JrAug 12, 2009
  2. Thomas RastAug 12, 2009
  3. 1/5 port --ignore-unmatch to "git add"Luke Dashjr, Aug 13, 2009
  4. 2/5 fix "git add --ignore-errors" to ignore pathspec errorsLuke Dashjr, Aug 13, 2009
  5. 3/5 Document --ignore-unmatch in git-add.txtLuke Dashjr, Aug 13, 2009
  6. 4/5 implement error_errno and warning_errnoLuke Dashjr, Aug 13, 2009
  7. 5/5 Convert add_file_to_index's lstat failure from a die to an errorLuke Dashjr, Aug 13, 2009
  8. Junio C HamanoAug 13, 2009
  9. Luke-JrAug 13, 2009
  10. port --ignore-unmatch to "git add"Luke Dashjr, Aug 13, 2009
  11. Document --ignore-unmatch in git-add.txtLuke Dashjr, Aug 13, 2009
  12. Junio C HamanoAug 13, 2009
  13. Luke-JrAug 13, 2009
  14. Alex RiesenAug 13, 2009
  15. Thomas RastAug 13, 2009
  16. Junio C HamanoAug 14, 2009
  17. Luke-JrAug 14, 2009
  18. Luke-JrAug 14, 2009
  19. Nanako ShiraishiAug 14, 2009
  20. Luke-JrAug 14, 2009
  21. Luke-JrOct 10, 2009

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.