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

Re: GIT and the current -stable

From
Uwe Kleine-König <ukleinek@informatik.uni-freiburg.de>
Date
Apr 14, 2007, 11:56 UTC
Message-ID
<20070414115600.GA10995@informatik.uni-freiburg.de>
In-Reply-To
<46206842.80203@gmail.com>
Hello Rene,
Rene Herman wrote:
Show 7 quoted lines
> each time that a new -stable is released. Rather though, I'd like a simple 
> "git pull" to do this while on this branch while a "git pull" while back on 
> the master branch pulls from the originally cloned Linus repo again.
> 
> Is this possible? Do I want it to be? Comments like "work like this 
> instead" welcome as well; figuring out what the heck it is that I want from 
> git seems to be one of the most difficult questions to answer...

Chris' mail made that somehow superfluous but anyhow. I have a Python script to update my Linux tree. It's attached.

It automatically adds git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-2.6.x.y as a remote as soon as v2.6.x is seen in Linus' repo and then fetches 2.6.16, 2.6.(last - 1) and 2.6.last. If you want to fetch all, change

	for stable in (16, last_stable - 1, last_stable):
in
	for stable in xrange(16, last_stable + 1):

The location of the repo is hardcoded to $HOME/gsrc/linux-2.6, but I think everyone with a bit of intuition should be able to change that ...

So it's not a "git pull" for me, but "update-linux".

Best regards Uwe

-- 
Uwe Kleine-König

main(){char*a="main(){char*a=%c%s%c;printf(a,34,a,34%c";printf(a,34,a,34
,10);a=",10);a=%c%s%c;printf(a,34,a,34,10);}%c";printf(a,34,a,34,10);}


#! /usr/bin/env python

import os, re, subprocess, sys

silent = False

git_dir = os.path.join(os.getenv('HOME'), 'gsrc', 'linux-2.6', '.git')
os.putenv('GIT_DIR', git_dir)

devnull = open('/dev/null', 'w', 0)
if silent:
  subprocess_stdout = devnull
else:
  subprocess_stdout = None

if not silent:
  print 'fetch origin'
subprocess.call(['git-fetch', 'origin'], stdout=subprocess_stdout)

sp_describe = subprocess.Popen(['git-describe', 'origin'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
sp_describe_stdin, sp_describe_stderr = sp_describe.communicate()

re_linuxver = re.compile('v2\.6\.(?P<minor>\d+)(?P<stable>\.\d+)?(?P<rc>-rc\d+)?(?P<git>-g[0-9a-fA-F]+)?')
mo = re_linuxver.match(sp_describe_stdin)

if not mo:
  print 'cannot parse version of origin\'s HEAD'
  sys.exit(1)

modict = mo.groupdict()

if modict['rc'] and not modict['stable']:
  last_stable = int(modict['minor']) - 1
else:
  last_stable = int(modict['minor'])

for stable in (16, last_stable - 1, last_stable):
  if subprocess.call(['git', 'repo-config', 'remote.v2.6.%d.y.url' % stable], stdout=devnull) != 0:
    subprocess.call(['git', 'repo-config', 'remote.v2.6.%d.y.url' % stable, 'git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-2.6.%d.y.git' % stable])
    subprocess.call(['git', 'repo-config', 'remote.v2.6.%d.y.fetch' % stable, 'refs/heads/master:refs/remotes/stable/v2.6.%d.y' % stable])
    subprocess.call(['git', 'repo-config', 'branch.v2.6.%d.y.remote' % stable, 'v2.6.%d.y' % stable])
    subprocess.call(['git', 'repo-config', 'branch.v2.6.%d.y.remote' % stable, 'v2.6.%d.y' % stable])
    subprocess.call(['git', 'repo-config', 'branch.v2.6.%d.y.merge' % stable, 'refs/heads/master'])

  if not silent:
    print 'fetch v2.6.%d.y' % stable
  subprocess.call(['git-fetch', 'v2.6.%d.y' % stable], stdout=subprocess_stdout)
Previous: Julian Phillips
Message 16 of 16 in “GIT and the current -stable”
  1. Rene HermanApr 14, 2007
  2. Junio C HamanoApr 14, 2007
  3. Rene HermanApr 14, 2007
  4. Greg KHApr 14, 2007
  5. Linus TorvaldsApr 14, 2007
  6. Gerb StralkoApr 14, 2007
  7. Chris WrightApr 14, 2007
  8. Rene HermanApr 14, 2007
  9. Rene HermanApr 14, 2007
  10. Julian PhillipsApr 15, 2007
  11. Brian GernhardtApr 14, 2007
  12. Chris WrightApr 14, 2007
  13. Brian GernhardtApr 14, 2007
  14. Chris WrightApr 14, 2007
  15. Julian PhillipsApr 14, 2007
  16. Uwe Kleine-KönigApr 14, 2007

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.