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

Re: my git problem

From
Daniel Barkalow <barkalow@iabervon.org>
Date
Apr 28, 2008, 19:52 UTC
Message-ID
<alpine.LNX.1.00.0804281537260.19665@iabervon.org>
In-Reply-To
<20080428114509.240ef4ae.akpm@linux-foundation.org>
On Mon, 28 Apr 2008, Andrew Morton wrote:
Show 41 quoted lines
> On Sun, 27 Apr 2008 13:24:08 -0700 (PDT) Linus Torvalds <torvalds@linux-foundation.org> wrote:
> > 
> > On Sun, 27 Apr 2008, Andrew Morton wrote:
> > > 
> > > But I'm pretty sure that the simple solutions were found wanting, but I
> > > don't recall why.  I think it was because of a problem when
> > > git-netdev-all is based on git-net which is based on origin.  I want to
> > > extract the git-net -> git-netdev-all diff, but doing that generates
> > > patches which reapply things which are already applied.
> > 
> > Well, if a tree has patches that are already applied up-stream, then yes, 
> > you do actually have to do the merge in order to see that. Because 
> > obviously the diff is in two places, and if they merge cleanly, one of 
> > them has to be made to not count.
> > 
> > So it depends on what you want.
> > 
> > 	git diff a...b
> > 
> > says literally "what has been added to 'b' since it diverged from 'a'". 
> > 
> > That is a useful and valid thing to ask, but it is very fundamentally also 
> > *not* the same thing as actually doing the merge, and asking what the 
> > merge added. Doing
> > 
> > 	git merge --no-commit otherbranch
> > 	git diff HEAD > diff
> > 	git reset --hard
> > 
> > will do that: it will do the merge (which obviously squashes any diffs 
> > that existed in the other tree as different commits), and then diffs the 
> > HEAD against that resulting state.
> > 
> 
> hm, weirdness.
> 
> y:/usr/src/git26> git-diff origin...git-ia64   
> y:/usr/src/git26> git-log origin...git-ia64 | wc -l
> 15574
> 
> I'd have expected git-log to operate on the same patches as git-diff.

I don't think this operation is even well-defined for git-log. What do you expect to see if origin contains some of the same changes as ia64, but where what changes are in the same patch are different on the two paths? Even more so, what if ia64 has some additional changes in a commit that had other changes that were left out of the origin version?

For the diff, it doesn't matter, but for log it would.
	-Daniel
*This .sig left intentionally blank*
Previous: Carl WorthNext: Andrew Morton
Message 16 of 21 in “my git problem”
  1. Andrew MortonApr 27, 2008
  2. Linus TorvaldsApr 27, 2008
  3. Andrew MortonApr 27, 2008
  4. Linus TorvaldsApr 27, 2008
  5. Andrew MortonApr 28, 2008
  6. Johannes SchindelinApr 28, 2008
  7. Andrew MortonApr 28, 2008
  8. Johannes SchindelinApr 28, 2008
  9. Linus TorvaldsApr 28, 2008
  10. J. Bruce FieldsApr 29, 2008
  11. Jakub NarebskiApr 30, 2008
  12. Andrew MortonApr 28, 2008
  13. Linus TorvaldsApr 28, 2008
  14. Andrew MortonApr 28, 2008
  15. Carl WorthMay 1, 2008
  16. Daniel BarkalowApr 28, 2008
  17. Andrew MortonApr 28, 2008
  18. Linus TorvaldsApr 28, 2008
  19. Johannes SchindelinApr 28, 2008
  20. Linus TorvaldsApr 28, 2008
  21. Andrew MortonApr 29, 2008

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.