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

Re: git pull on Linux/ACPI release tree

From
DMDavid S. Miller <davem@davemloft.net>
Date
Jan 8, 2006, 08:16 UTC
Message-ID
<20060108.001651.02992220.davem@davemloft.net>
In-Reply-To
<F7DC2337C7631D4386A2DF6E8FB22B3005A13489@hdsmsx401.amr.corp.intel.com>
From: "Brown, Len" <len.brown@intel.com>
Date: Sun, 8 Jan 2006 02:47:30 -0500
> I'm probably a naïve git user -- but I expect I have a lot of company.
> If there is a better way of using the tool to get the job done,
> I'm certainly a willing customer with open ears.

What I do is simply build a new fresh tree if I feel the urge to sync with the top of Linus's tree. I use the script below which I call "git suck". It just sucks the patches out of one tree and sticks them into another tree. You go:

bash$ cd new-2.6 bash$ git suck ../foo-2.6

It preserves everything except the dates, and it's so incredibly cheap and fast with GIT.

I know a lot of people react to this kind of usage with "what's the point of the source control system if you're just messing with patches in and out of the tree all the time" But as a subsystem maintainer, you deal with a lot of changes and it's important to get a pristine clean history when you push things to Linus.

In fact, I do this so much that Linus's tree HEAD often equals my origin when he pulls.

Merges really suck and I also hate it when the tree gets cluttered up with them, and Linus is right, ACPI is the worst offender here.

Yes, we can grep the merges out of the shortlog or whatever, but that merging crap is still physically in the tree.

Just don't do it. Merge into a private branch for testing if you don't want to rebuild trees like I do, but push the clean tree to Linus.

#!/bin/sh
#
# Usage: git suck path-to-tree
#
# Pull all patches relative to 'origin' from the tree specified
# and apply them to the current directory tree, keeping all changelog
# and authorship information identical.  It will update the dates
# of the changes of course.
(cd $1; git format-patch --mbox origin) || exit 1
for i in $1/*.txt
do
   sed 's/\[PATCH\] //' <$i >tmp.patch
   git-applymbox -k tmp.patch || exit 1
done
Previous: Brown, LenNext: Junio C Hamano
Message 2 of 7 in “RE: git pull on Linux/ACPI release tree”
  1. Brown, LenJan 8, 2006
  2. David S. MillerJan 8, 2006
  3. Junio C HamanoJan 8, 2006
  4. Catalin MarinasJan 8, 2006
  5. Linus TorvaldsJan 8, 2006
  6. Al ViroJan 9, 2006
  7. Linus TorvaldsJan 9, 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.