Subject: Re: [sup-devel] What's your workflow?

From: William Morgan <[email-masked]>
Date: Tue, 29 Dec 2009 16:01:53 -0800

Reformatted excerpts from Tero Tilus's message of 2009-12-29:
> Assume I have a feature-branch which is merged to my-daily-sup and I
> go --amend a commit in that feature-branch.  How would I now get
> my-daily-sup up to date?  (also assume that merge from feature-branch
> is not the tip of my-daily-sup so that git reset HEAD^ && git merge
> feature-branch is not a solution)

If you --amend, then remerging will likely create a conflict. There
might be a way of rebase -i on my-daily-sup to leave off the original
merge commit, or you could "unmerge it" with the horribleness that is
`git revert -m 1` on the original merge commit, leaving daily-sup with
some reverse commits.

The short answer is: don't do that. Avoid things that change the head on
a branch that's been published or merged or otherwise used. Make an
additional commit instead of --amend, or be prepared to do some work.

(I realize this isn't ideal because presumably you're trying to keep
both a clean topic branch and a clean daily-sup branch, but rebasing and
amending necessarily drops the history that git needs to merge changes
properly.)
-- 
William <[email-masked]>
_______________________________________________
Sup-devel mailing list
[email-masked]
http://rubyforge.org/mailman/listinfo/sup-devel

---

From: Ben Walton <[email-masked]>
Date: Tue, 29 Dec 2009 15:40:25 -0500

Excerpts from Tero Tilus's message of Tue Dec 29 15:14:45 -0500 2009:

> Wiki page just doesn't say anything on how to have your own daily-sup
> branch (master or next + a set of own and others' patches) and how to
> keep that up-to-date with upstream while your develop your own patches
> (which are supposed to live in topic branches).

Maybe something like Stacked Git would work for you?

http://www.procode.org/stgit/

Alternately, if you want to stick to plain git, I'd recommend
something like:

origin/master -> master
origin/next -> next
	       |
	       \ mybranch

Where 'mybranch' collects your locally desired deviations.  If you're
not familiar with git, you'll want to do, assuming you've already got
a good repo that is tracking both origin/* branches.

Now, you can do:

git checkout -b mybranch next

As you update next with changes from origin/next, you can 'move' your
local changeset forward with:

git rebase next

If you don't explicitly track the next branch locally, you can do:

git checkout -b mybranch origin/next

and then

git rebase origin/next

as you do `git fetch` to get changes from upstream.

Be sure to do any devel work you expect to send back to the project as
a branch from master though, as that makes integration easier
upstream.

HTH.
-Ben
-- 
Ben Walton
Systems Programmer - CHASS
University of Toronto
C:416.407.5610 | W:416.978.4302

GPG Key Id: 8E89F6D2; Key Server: pgp.mit.edu
Contact me to arrange for a CAcert assurance meeting.
_______________________________________________
Sup-devel mailing list
[email-masked]
http://rubyforge.org/mailman/listinfo/sup-devel

---

From: Tero Tilus <[email-masked]>
Date: Tue, 29 Dec 2009 21:34:33 +0200

I'm still a bit newbie with git.  I'd like to hear how do you folks
develop/use sup.  What's your workflow?  Do you run master, next or
some own branch?  If own, where do you fork and how do you track
upstream and your own patches?  Detailed git commands appreciated.

-- 
Tero Tilus ## 050 3635 235 ## http://tero.tilus.net/
_______________________________________________
Sup-devel mailing list
[email-masked]
http://rubyforge.org/mailman/listinfo/sup-devel

---

From: Tero Tilus <[email-masked]>
Date: Wed, 30 Dec 2009 00:03:26 +0200

William Morgan, 2009-12-29 22:43:
> If you have feature branches merged into daily-sup, I think you need
> to use `git rebase -p next` to get it to recreate those merges. But
> I've never gotten that complex.

If _you_ haven't done that it makes me think I'm seriously
overengineering something here (or is it just because you are the
maintainer and aren't pulling your next from anybody?)

What is your daily-sup?

---

From: William Morgan <[email-masked]>
Date: Tue, 29 Dec 2009 14:51:12 -0800

Reformatted excerpts from Tero Tilus's message of 2009-12-29:
> Does it "just work" if I have feature branches off of master which are
> merged to mybranch and the feature patches get accepted and appear to
> next?

It certainly works for the case where you're merging from next into your
daily_sup branch, and rebase will happily drop changes that are
duplicated by the target, so I would guess that rebase would do the
right thing with redundant merges. Maybe a test is in order!
-- 
William <[email-masked]>
_______________________________________________
Sup-devel mailing list
[email-masked]
http://rubyforge.org/mailman/listinfo/sup-devel

---

From: William Morgan <[email-masked]>
Date: Tue, 29 Dec 2009 11:58:30 -0800

> upstream and your own patches?  Detailed git commands appreciated.

See http://sup.rubyforge.org/wiki/wiki.pl?Contributing, and feel free to
tweak that as appropriate!
-- 
William <[email-masked]>
_______________________________________________
Sup-devel mailing list
[email-masked]
http://rubyforge.org/mailman/listinfo/sup-devel

---

From: "Edward Z. Yang" <[email-masked]>
Date: Tue, 29 Dec 2009 14:41:34 -0500

> upstream and your own patches?  Detailed git commands appreciated.

When I used to maintain a few patches on top of Git (I don't think I
have any right now, since they became unnecessary when I switched
to Xapian and OfflineImap), I'd have them on top of my local next
branch; when pulling changes I'd:

    git fetch
    git rebase origin/next

I used to run master, but switched to next on advice that it was fairly
stable.

Cheers,
Edward

---

From: William Morgan <[email-masked]>
Date: Tue, 29 Dec 2009 14:33:05 -0800

> What is your daily-sup?

I use next and don't have personal patches because I publish all the
code I write. (I do have code branches that I don't publish, but those
aren't things that I run as daily-sup).

I don't think you're overengineering. Git is good at maintaining local
changesets like this.
-- 
William <[email-masked]>
_______________________________________________
Sup-devel mailing list
[email-masked]
http://rubyforge.org/mailman/listinfo/sup-devel

---

From: Tero Tilus <[email-masked]>
Date: Tue, 29 Dec 2009 23:58:47 +0200

> http://www.procode.org/stgit/

Now _that_ is something i've been dreaming of!  Thanks a lot.  Even if
I don't end up using stgit on sup development, I know I'll use it in
quite a few other places.

> Where 'mybranch' collects your locally desired deviations.

---

From: Tero Tilus <[email-masked]>
Date: Wed, 30 Dec 2009 01:03:29 +0200

I think I gradually start to figure out how to get rid of habits I
find messy.  Thanks a ton already guys!

Still one thing.

---

From: Tero Tilus <[email-masked]>
Date: Tue, 29 Dec 2009 22:14:45 +0200

William Morgan, 2009-12-29 21:58:
> See http://sup.rubyforge.org/wiki/wiki.pl?Contributing

Believe me, I have.  That's pretty much why I got this far in the
first place.  ;)

---

From: William Morgan <[email-masked]>
Date: Tue, 29 Dec 2009 12:43:15 -0800

> (which are supposed to live in topic branches).

You should be able to make a daily-sup branch off of (say) next, apply
all your patches, and whenever next changes and you want to update,
rebase like so:

$ git checkout next
$ git pull
$ git checkout daily-sup
$ git rebase next

If you have feature branches merged into daily-sup, I think you need to
use `git rebase -p next` to get it to recreate those merges. But I've
never gotten that complex.

(You could also just merge in next each time, which might be easier.
Rebase has the advantage of keeping your patch set up to date with the
remote branch, though, which might be nice if you decide to publish
them.)
-- 
William <[email-masked]>
_______________________________________________
Sup-devel mailing list
[email-masked]
http://rubyforge.org/mailman/listinfo/sup-devel