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

Re: Updated Kernel Hacker's guide to git

From
Junio C Hamano <junkio@cox.net>
Date
Dec 21, 2006, 07:32 UTC
Message-ID
<7vk60l1z7u.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<46a038f90612202304uabdffacld857cfcb90ec3e76@mail.gmail.com>
"Martin Langhoff" <martin.langhoff@gmail.com> writes:
Show 6 quoted lines
> On 12/21/06, Jay Cliburn <jacliburn@bellsouth.net> wrote:
>> $ git diff $(git merge-base master driver)..driver
>
> There is a nicer way to do it with 1.4.x git -- note the 3 dots:
>
> $ git diff master...driver
Careful.
I think Jay was looking at this kind of ancestry graph:
         *---*---*---* driver
        /
 --o---o---x---x---x---x master

There might be quite a few merges on either side, but the point is '*' are not yet 'in', and 'o' and 'x' are already in the 'upstream (but 'x' are not in Jay's driver yet).

The three dots would give both '*' and 'x'; I do not think that is what Jay wants. A submitter to mainline usually wants only '*' commits.

I've always thought that 'submission' is supposed to be done as a series of patches, in which case a reasonable way would be to do:

	git format-patch -n master driver

If on the other hand a single roll-up patch is desired, I think the most reasonable thing to do is to first merge the tip of the master to the tip of driver, resolve all the conflicts as needed, and take the diff between the 'master' and the result:

         *---*---*---*---y driver (y is the test merge)
        /               / 
 --o---o---x---x---x---x master
	git checkout driver
        git merge master
	... resolve conflicts if any, then "git commit"
	git diff master

This diff by definition should apply cleanly to the tip of 'master' and would result in the source that contains the updates for the driver.

When you are done, it would be advisable to do:
	git reset --hard HEAD^

to remove that 'y' merge, unless the merge involved a true conflict resolution.

Previous: Martin LanghoffNext: Linus Torvalds
Message 4 of 14 in “Updated Kernel Hacker's guide to git”
  1. Jeff GarzikDec 21, 2006
  2. Jay CliburnDec 21, 2006
  3. Martin LanghoffDec 21, 2006
  4. Junio C HamanoDec 21, 2006
  5. Linus TorvaldsDec 21, 2006
  6. Jeff GarzikDec 21, 2006
  7. Willy TarreauDec 21, 2006
  8. Nigel CunninghamDec 21, 2006
  9. Jeff GarzikDec 21, 2006
  10. Nigel CunninghamDec 21, 2006
  11. Francois RomieuDec 21, 2006
  12. Guennadi LiakhovetskiDec 21, 2006
  13. Jeff GarzikDec 21, 2006
  14. Jesper JuhlDec 22, 2006

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.