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

Re: Updated Kernel Hacker's guide to git

From
JGJeff Garzik <jeff@garzik.org>
Date
Dec 21, 2006, 11:53 UTC
Message-ID
<458A75B2.6050201@garzik.org>
In-Reply-To
<4589FD9E.2010000@bellsouth.net>
Jay Cliburn wrote:
Show 27 quoted lines
> Jeff Garzik wrote:
>> I refreshed my git intro/cookbook for kernel hackers, at 
>> http://linux.yyz.us/git-howto.html
>>
>> This describes most of the commands I use in day-to-day kernel 
>> hacking.  Let me know if there are glaring errors or missing key 
>> commands.
> 
> Thanks for doing this.  I've referred to your previous page rather often 
> as I grope around trying to learn git and hack a vendor driver for 
> submittal into the mainline kernel.
> 
> One thing that baffled me was how to use git to create a "kitchen sink" 
> diff that would produce my entire driver suitable for submittal to lkml 
> for review.  This probably isn't needed very often, but for new driver 
> submittals it's important to know how to do it.  Francois Romieu showed 
> me how (assume the new driver branch is named "driver"):
> 
> $ git diff $(git merge-base master driver)..driver
> 
> As a beginner, this command continues to be utterly non-intuitive to me, 
> but it works.  There may be other ways to do it, too.
> 
> The point is, I think you should add instructions on your cookbook that 
> address how to produce such a "kitchen sink" diff if you're submitting a 
> brand new driver to lkml.  (Obviously I don't know what such a diff is 
> actually called.)

You inflict upon yourself all sorts of pain if you keep updating 'master', but don't merge that into 'driver'. Typically you want to rebase after updating master:

	git checkout driver
	git rebase master
	# build and test
	git prune
or merge master into your current branch:
	git checkout driver
	git pull . master
	# build and test
That way, you are GUARANTEED that
	git diff master..driver
will result in a diff that you can send upstream.

One moral of this story, as (I think) Linus mentioned, don't update 'master' too frequently. That's one key lesson of distributed programming. Unless the upstream kernel has a key API change or bug fix you need, just pretend the outside world does not exist, and hack away on your driver.

	Jeff
Previous: Linus TorvaldsNext: Willy Tarreau
Message 6 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.