Re: Please undo "Use git-merge instead of git-resolve in git-pull"
On Wed, 21 Sep 2005, David S. Miller wrote:
Show 6 quoted lines
>
> You know, I personally was unaware that this was supported until now.
> I have been always reverting local debugging changes in order to merge
> other people's work in, then reapply the debugging changes afterwards.
>
> I guess I won't have to do that any more. :-)
Absolutely.
It will happily merge a dirty tree, as long as none of the dirty files were modified.
And by "dirty" I mean "index matches HEAD, but contents do not match index".
It's very convenient. I usually have my local Makefile updated for the next version for a few days before actually committing it, and I tend to have any experimental patches that I sent out to people uncommitted in my tree too, just to remind me and to test them.
Show 6 quoted lines
> So as long as they don't interfere, you can keep local debugging
> changes out of GITs way for just about anything right? For example,
> as long as you don't "git-update-cache foo.c" those files in your
> local debugging hack, you can just "git commit" afterwards and
> only put in the changes you want. It won't myseriously find those
> modified files and what to do something with them right?
That's correct. Also, since this is how I work, I've tried to make sure that the tools I work with are "safe". For example, git-applymbox will happily apply patches to a dirty tree, because it uses "git-apply --index" that refuses to apply a patch to a file that is modified.
So it's perfectly safe to merge somebody elses _patch_ too - even with a tree with patches. But git-applymbox will refuse to apply patches on a tree where your index doesn't match the HEAD commit. So it's safe to have a _dirty_ tree, but if you've done an "update-cache" and have an index that doesn't match the parent any more, git-applymbox will refuse to run.
(Btw, that's something that I haven't checked whether I verified properly in git-read-tree.. I basically never have my index out of sync with my HEAD, but I should probably verify).
Linus