Re: git-rm isn't the inverse action of git-add

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Christian Jaeger
Date: Monday, July 2, 2007 - 1:23 pm

Yann Dirson wrote:

It doesn't force you to issue 2 commands: the -f option to cg-rm unlinks
the file for you. So you only have to type an additional "-f".

Yes it's probably (partly) a matter of taste: in my bash startup files I
have mv aliased to mv -i and rm to rm -i, so that it asks me whether I'm
sure to delete or overwrite a file. If I know in advance that I'm sure,
I just type "rm -f $file", which then expands to "rm -i -f $file" where
the -f overrides the -i. cg-rm -f just fits very well into this scheme
(the only difference being that "cg-rm $file" doesn't explicitely ask me
whether I also want the file to be unlinked). (BTW note that usually for
removing a file I use a "trash" (or shorter alias "tra") command, which
moves it to a trash can instead of deleting; so I use "tra $file" by
default, and only for big files or when I'm sure I immediately want to
delete them, I use rm, and then if the paths are clear I add the -f
flag, if not (like globbing involved), I don't add the -f and thus am
asked for confirmation.)

If I could alias the git-rm command so that the default action is the
reverse of git-add and adding an -f flag removes it from disk, that
would be fine for me.


This doesn't sound very intuitive to me (and I couldn't fix it with an
alias).

I don't per se require undo actions. I just don't understand why git-rm
refuses to remove the file from the index, even if I didn't commit it.
The index is just an intermediate record of the changes in my
understandings, and the rm action would also be intermediate until it's
being committed. And a non-committed action being deleted shouldn't need
a special confirmation from me, especially not one which is consisting
of a combination of two flags (of which one is a destructive one).

Christian.

-
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:
git-rm isn't the inverse action of git-add, Christian Jaeger, (Mon Jul 2, 11:09 am)
Re: git-rm isn't the inverse action of git-add, Yann Dirson, (Mon Jul 2, 12:42 pm)
Re: git-rm isn't the inverse action of git-add, Christian Jaeger, (Mon Jul 2, 1:23 pm)
Re: git-rm isn't the inverse action of git-add, Yann Dirson, (Mon Jul 2, 1:40 pm)
Re: git-rm isn't the inverse action of git-add, Matthieu Moy, (Mon Jul 2, 1:54 pm)
Re: git-rm isn't the inverse action of git-add, Johannes Schindelin, (Mon Jul 2, 2:05 pm)
Re: git-rm isn't the inverse action of git-add, Christian Jaeger, (Mon Jul 2, 2:20 pm)
Re: git-rm isn't the inverse action of git-add, Jeff King, (Mon Jul 2, 9:12 pm)
Re: git-rm isn't the inverse action of git-add, Junio C Hamano, (Mon Jul 2, 9:47 pm)
Re: git-rm isn't the inverse action of git-add, Jeff King, (Mon Jul 2, 9:59 pm)
Re: git-rm isn't the inverse action of git-add, Junio C Hamano, (Mon Jul 2, 10:09 pm)
Re: git-rm isn't the inverse action of git-add, Jeff King, (Mon Jul 2, 10:12 pm)
Re: git-rm isn't the inverse action of git-add, Junio C Hamano, (Mon Jul 2, 11:26 pm)
Re: git-rm isn't the inverse action of git-add, Matthieu Moy, (Tue Jul 3, 3:37 am)
Re: git-rm isn't the inverse action of git-add, Johannes Schindelin, (Tue Jul 3, 5:09 am)
Re: git-rm isn't the inverse action of git-add, Matthieu Moy, (Tue Jul 3, 6:40 am)
Re: git-rm isn't the inverse action of git-add, Johannes Schindelin, (Tue Jul 3, 7:21 am)
Re: git-rm isn't the inverse action of git-add, Jan Hudec, (Wed Jul 4, 1:08 pm)
Re: git-rm isn't the inverse action of git-add, Matthieu Moy, (Thu Jul 5, 6:44 am)
Re: [RFC][PATCH] Re: git-rm isn't the inverse action of gi ..., Johannes Schindelin, (Sun Jul 8, 11:10 am)
Re: [RFC][PATCH] Re: git-rm isn't the inverse action of gi ..., Johannes Schindelin, (Sun Jul 8, 2:49 pm)