Re: [PATCH 0/2] Making "git commit" to mean "git commit -a".

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Johannes Schindelin <Johannes.Schindelin@...>
Cc: Junio C Hamano <junkio@...>, Carl Worth <cworth@...>, Nicolas Pitre <nico@...>, <git@...>
Date: Wednesday, November 29, 2006 - 11:10 pm

On Thu, 30 Nov 2006, Johannes Schindelin wrote:

I (very) occasionally do this for patches I get.

You can do

	git-apply --index patch

and it will apply the patch and update the index for you. That's great for 
committing the patch (because it means that it adds and removes your files 
automatically for you), but most of the time when I get an email that I 
want to apply, I just use "git-applymbox".

So where doing the "git apply --index" thing is great is when you see a 
patch that has some obvious deficiency that makes you not want to commit 
it directly, but add some fixup of your own.

That's when it's useful to use the index to your advantage - you can do 
"git diff" (to see just the fixups you did on top of the patch), or you 
can do "git diff HEAD" (to see the combined effect of both the patch _and_ 
your fixups).

That said, I have to admit that I usually (a) don't do this very often (ie 
this is not part of my daily routine) and (b) I tend to do "git reset" 
fairly soon afterwards (or alternatively, just "git commit -a") to get 
back to the situation where the index will match the current HEAD 100% 
again. So the "index doesn't match HEAD" situation is always just a 
_temporary_ thing for me.

		Linus
-
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:
Re: [PATCH 0/2] Making "git commit" to mean "git commit -a"., Johannes Schindelin, (Wed Nov 29, 10:11 pm)
Re: [PATCH 0/2] Making "git commit" to mean "git commit -a"., Linus Torvalds, (Wed Nov 29, 11:10 pm)
Re: [PATCH 0/2] Making "git commit" to mean "git commit -a"., Andreas Ericsson, (Thu Nov 30, 7:09 am)
Re: [PATCH 0/2] Making "git commit" to mean "git commit -a"., Linus Torvalds, (Thu Nov 30, 11:58 am)
Re: [PATCH 0/2] Making "git commit" to mean "git commit -a"., Robert Shearman, (Thu Nov 30, 5:33 pm)
Re: [PATCH 0/2] Making "git commit" to mean "git commit -a"., Andreas Ericsson, (Fri Dec 1, 4:59 am)
Re: [PATCH 0/2] Making "git commit" to mean "git commit -a"., Linus Torvalds, (Thu Nov 30, 10:44 pm)
Re: [PATCH 0/2] Making "git commit" to mean "git commit -a"., Michael K. Edwards, (Thu Nov 30, 11:52 pm)
Re: [PATCH 0/2] Making "git commit" to mean "git commit -a"., Johannes Schindelin, (Thu Nov 30, 6:27 am)
Re: [PATCH 0/2] Making "git commit" to mean "git commit -a"., Junio C Hamano, (Wed Nov 29, 10:12 pm)