git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Linus Torvalds <torvalds@osdl.org>
To: Matt McCutchen <hashproduct@verizon.net>
Cc: git@vger.kernel.org
Subject: Re: How to switch kernel customizations from 2.6.15.6 to 2.6.16?
Date: Tue, 28 Mar 2006 18:10:46 -0800 (PST)	[thread overview]
Message-ID: <Pine.LNX.4.64.0603281749060.15714@g5.osdl.org> (raw)
In-Reply-To: <1143596622.2481.10.camel@mattlaptop.metaesthetics.net>



On Tue, 28 Mar 2006, Matt McCutchen wrote:
> 
> I made a customized Linux kernel based on 2.6.15.6 by cloning the stable
> 2.6.15 kernel repository (which was then at version 2.6.15.6) and making
> several commits.  Now I would like a Linux kernel based on 2.6.16 with
> the same customizations.  This seems to be a very simple task, but I
> have been trying various combinations of git commands for several days
> and have not figured out how to do it.
> 
> I believe that means I should pull the 2.6.16 kernel into the "origin"
> branch and then rebase the "master" branch, 

Don't "Pull". "Fetch".

"Pull" implies a merge, which is not what you want.

>		 To this end, I switched my remote file to point to the
> 2.6.16 stable repository and tried to pull.  The result was not what I
> wanted.  The situation is complicated by the fact that 2.6.15.6 is not
> an ancestor of 2.6.16.  The warning in the man page about branches that
> are modified nonlinearly seems to apply.

Just realize that you can have any number of branches, and instead of 
forcing "origin" to be something that it simply is not, just create a new 
branch called "linus".

Make that point to my tree, and do

	git fetch linus

to update it. It really is that easy.

Exact commands something like this:

 (1) Edit your .git/remotes/linus file so that it has the following 
     contents:

	URL: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
	Pull: refs/heads/master:refs/heads/linus

 (2) Use that to fetch my tree as the "linus" branch:

	git fetch linus

and now you have at least a nice new branch that contains the "standard" 
kernel. At which point you just need to do

 (3) rebase the work since "origin" onto "linus":

	git rebase --onto linus origin

I really really despise the "git rebase" command line syntax, and I find 
it very non-inuitive, but what this does is take your current branch, 
compare its contents to "origin" (ie where you started from), and then 
just rebase the commits onto the state that is "linus".

[ Junio: syntax comments:

  Personally, I think the rebase syntax sucks, because the _natural_ way 
  to do it is to just describe the set of commits to rebase the same way 
  we describe all _other_ commit sets: as a "begin..end" sequence.

  So I think rebase _should_ work something like this:

	git rebase origin.. [--onto] linus

  ie just giving an arbitrary range. This is even more noticeable for 
  "git-format-patch", where that insane "<his> [<mine>]" syntax is even 
  worse, for no good reason, when again it should really just work like 
  "git diff" where giving a single revision implies a single revision, and 
  giving a range implies a range, and no strange "mine" vs "his" rules ]

Oh well. Syntax rant over.

			Linus

  reply	other threads:[~2006-03-29  2:10 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-29  1:43 How to switch kernel customizations from 2.6.15.6 to 2.6.16? Matt McCutchen
2006-03-29  2:10 ` Linus Torvalds [this message]
2006-03-29  2:30   ` Junio C Hamano
2006-03-29  3:58   ` Junio C Hamano
2006-03-29 19:27     ` Linus Torvalds
2006-03-29 19:39       ` Linus Torvalds
2006-03-29 20:24       ` Junio C Hamano
2006-03-30  1:59       ` Rebase semantic and cherry-pick Jakub Narebski
2006-03-30  2:38         ` Junio C Hamano
2006-03-30  2:54           ` Linus Torvalds
2006-03-30  3:40             ` Junio C Hamano
2006-03-30  3:15       ` How to switch kernel customizations from 2.6.15.6 to 2.6.16? Junio C Hamano
2006-03-29  2:23 ` Shawn Pearce
2006-03-29  2:26 ` Junio C Hamano
2006-03-30  3:01   ` Matt McCutchen
2006-03-30  3:22     ` Junio C Hamano
2006-03-30  3:47       ` Matt McCutchen
2006-03-30 17:32     ` Linus Torvalds
2006-03-30 21:50       ` Matt McCutchen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.64.0603281749060.15714@g5.osdl.org \
    --to=torvalds@osdl.org \
    --cc=git@vger.kernel.org \
    --cc=hashproduct@verizon.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).