Re: [PATCH,RFC] Implement 'git rm --if-missing'

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Ciaran McCreesh <ciaran.mccreesh@...>
Cc: <git@...>
Date: Wednesday, July 16, 2008 - 2:48 pm

Ciaran McCreesh <ciaran.mccreesh@googlemail.com> writes:


This probably is a borderline with feaping creaturism.  What's the use of
it in a real workflow that you need this for?

"git add -u" may be too broad in that it also adds anything modified, but
so is --if-missing too broad in that it removes anything removed, and if
you are going to limit by giving pathspecs _anyway_, then...

Old timers might just do:

	git diff --name-only --diff-filter=D |
        git update-index --remove --stdin

;-)


Not your fault in entirety, but we should drop these " = 0"
initializations for static variables in a clean-up patch.


Perhaps the command should error out if some of the named files still
exist in the working tree?


 (1) (Style).  Opening brace comes on the same line as "if ()".

 (2) (Design). How should this new option interact with --cached mode of
     operation?

 (3) (Design). Shouldn't "git rm --if-missing" without any pathspec remove
     all missing paths from the index?

 (4) If lstat fails due to I/O error or something, you do not continue and
     add that path you did not get ENOENT for to the kill-list.  Is that
     desirable?

 (5) I wonder if lstat() is enough here.  

     Consider:

	- current commit has "kernel" symlink to "linux-2.6/" directory but
          you want to remove kernel and move directory linux-2.6 to it, so:

          - you run "rm kernel; mv linux-2.6 kernel"

	  - then you run "git rm --if-missing -- kernel"

     What should the command do?
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH,RFC] Implement 'git rm --if-missing', Ciaran McCreesh, (Wed Jul 16, 2:00 pm)
Re: [PATCH,RFC] Implement 'git rm --if-missing', Junio C Hamano, (Wed Jul 16, 2:48 pm)
Re: [PATCH,RFC] Implement 'git rm --if-missing', Peter Baumann, (Wed Jul 16, 2:58 pm)
Re: [PATCH,RFC] Implement 'git rm --if-missing', David Christensen, (Wed Jul 16, 3:43 pm)
Re: [PATCH,RFC] Implement 'git rm --if-missing', Petr Baudis, (Wed Jul 16, 2:06 pm)
Re: [PATCH,RFC] Implement 'git rm --if-missing', Avery Pennarun, (Wed Jul 16, 2:17 pm)