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

Re: Please undo "Use git-merge instead of git-resolve in git-pull"

From
Linus Torvalds <torvalds@osdl.org>
Date
Sep 22, 2005, 00:39 UTC
Message-ID
<Pine.LNX.4.58.0509211730560.2553@g5.osdl.org>
In-Reply-To
<20050921.172849.103555057.davem@davemloft.net>
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
Previous: David S. MillerNext: Olivier Galibert
Message 6 of 10 in “Please undo "Use git-merge instead of git-resolve in git-pull"”
  1. Linus TorvaldsSep 21, 2005
  2. Linus TorvaldsSep 21, 2005
  3. Junio C HamanoSep 21, 2005
  4. Linus TorvaldsSep 21, 2005
  5. David S. MillerSep 22, 2005
  6. Linus TorvaldsSep 22, 2005
  7. Olivier GalibertSep 22, 2005
  8. Martin LanghoffSep 22, 2005
  9. Linus TorvaldsSep 22, 2005
  10. Petr BaudisSep 23, 2005

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.