git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andreas Ericsson <ae@op5.se>
To: George Spelvin <linux@horizon.com>
Cc: git@vger.kernel.org
Subject: Re: Git workflow: how to achieve?
Date: Tue, 28 Apr 2009 17:00:10 +0200	[thread overview]
Message-ID: <49F719FA.8050700@op5.se> (raw)
In-Reply-To: <20090428140248.31237.qmail@science.horizon.com>

George Spelvin wrote:
>>> We may have a language problem.  "very little detail" means almost no detail,
>>> an absence of details.  Did you mean "every little detail"?
>> No, I mean with very little detail. Usually when trying to answer a
>> question and I can't make sense of the question itself it's because
>> the person asking has already started down some road and entered into
>> a frame of mind which I cannot share. That mindset may not be correct
>> to solve the problem, so removing detail usually helps.
> 
> Ah, sorry, you wanted more abstract, not more concrete.
> 
>> "I'd like to automatically merge a bunch of branches and compile-test them
>> on every commit. How do I go about doing that?" is a much more open question
>> that invites to giving a lot more correct answers. Since you haven't asked
>> such a high-level question yet, I'm not sure what your need is, and therefore
>> I cannot help you find a suitable solution.
> 
> Okay, "I'd like to commit to somewhere further back in the history rather
> than HEAD, and have the HEAD automagically rebased".  How do I do that?
> 

Now we're talking.

If I were you, I'd do (assuming 'master' is upstream's head):

git checkout -b private/test master
git merge $all_feature_branches
# some sort of failure detected
git checkout $failed_topic
git rebase -i -p $(git merge-base HEAD master)
# select 'edit' for the commits you want to edit
git branch -D private/test
# goto 1


There may be even simpler workflows. I do not know.

>>> It actually came to mind recently during $DAY_JOB work, but let me give a
>>> concrete example based on the Linux kernel:
>>>
>>> I am running a customized Linux kernel.  On top of Linus's base,
>>> I have local patches to enable 64-bit DMA on the SB600 SATA controller,
>>> some local patches to make the RAID (md) code print out the locations
>>> of mismatches when verifying, the EDAC quilt series, a merge of the
>>> LinuxPPS code, a number of local patches to the LinuxPPS code (that
>>> I'm discussing with Rodolfo Giometti), and some revisions to the serial
>>> interrupt handler (that I'm discussing with Alan Cox).
>>>
>>> There's also the beginning of an ethernet driver that I'm trying to
>>> write, but it's going slow.
>>>
>>> Every week or two, I rebase all that on top of Linus's latest.  Plain
>>> rebase doesn't like the LinuxPPS merge, so I've been doing it manually
>>> in two parts.  Although rebase -p is apprently working much better than
>>> I remember.
>> This step is rather unnecessary unless there are changes to API's you
>> depend on. Doing a single rebase once you're done with the patch-series
>> would be far better and would, I expect, remove quite a lot of the
>> complexity you're experiencing.
> 
> *Frustration*  I'm somehow having trouble communicating.
> 
> I need to rebase it so I have a merged source tree that I can compile
> and test.  How else can I test Linus's latest plus my local changes?
> What alternative are you suggesting?
> 
> I want, AT ALL TIMES, to be running the kernel consisting of
> Linus's latest plus my various local hacks.  I want to be able to
> freely update any of the components that make up the result,
> and have the sum automatically recomputed for me.
> 

Just merge them in. You're going through an obscene amount of trouble
just to keep everything linear when there's no need for you to do so.

  git checkout private/test
  git merge master

to merge latest upstream stuff. If you get conflicts, you may have to
amend your patch-series with one or more extra commits to resolve those
conflicts, but there's no need to rebase them again if there are zero
conflicts (and all tests pass, ofcourse; Not all post-merge code
conflicts are caused by the actual merge algorithm).

If there are no new breakages or no new conflicts, there's no need to
rebase your topics again at this point.

>>> Currently, some patches get deeply buried in the stack and I have to
>>> do a lot of deep rebasing.
>> I'm not sure what you mean by "deep rebasing" or "stack", unless you've
>> started using topgit already (which, I believe, does patch-stacks).
>>
>> No patch should ever get "deeply buried" unless you do really, really
>> weird things with your topic-branches though. They *should* remain the
>> same each and every time.
> 
> I mean that the patch I want to edit is 20 or more patches back
> in history (I'm running 2.6.30-rc3-00063-gd3de9aa at the moment),
> so amending it involves a considerable amount of rebasing.
> 
> (Because I'm currently organized as a linear list of local
> patches on top of upstream.  I'd prefer separate feature
> branches plus merges, but that's what I'm asking how to make
> work efficiently.)

I think I answered this up above, but I'm superbly tired right now so
it's entirely possible I misunderstood one thing or another.

-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

Register now for Nordic Meet on Nagios, June 3-4 in Stockholm
 http://nordicmeetonnagios.op5.org/

Considering the successes of the wars on alcohol, poverty, drugs and
terror, I think we should give some serious thought to declaring war
on peace.

  reply	other threads:[~2009-04-28 15:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-24  4:58 Git workflow: how to achieve? George Spelvin
2009-04-24  7:31 ` Uwe Kleine-König
2009-04-24  7:35 ` Andreas Ericsson
2009-04-27 22:59   ` George Spelvin
2009-04-28  7:24     ` Andreas Ericsson
2009-04-28 14:02       ` George Spelvin
2009-04-28 15:00         ` Andreas Ericsson [this message]
2009-04-28 15:59         ` Sitaram Chamarty

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

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

  git send-email \
    --in-reply-to=49F719FA.8050700@op5.se \
    --to=ae@op5.se \
    --cc=git@vger.kernel.org \
    --cc=linux@horizon.com \
    /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.
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 NNTP newsgroup(s).