Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
some Git workflow experiences
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  11 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Myk Melez  
View profile  
 More options Nov 12 2010, 9:26 pm
From: Myk Melez <m...@mozilla.org>
Date: Fri, 12 Nov 2010 18:26:05 -0800
Local: Fri, Nov 12 2010 9:26 pm
Subject: some Git workflow experiences

Hi all,

Warning: Git wonkery ahead, with excruciating details. I would not want
to read this message. I recommend you skip it. ;-)

Part 1: Wherein I Handle My First Pull Request

To fix some test failures, Atul submitted GitHub pull request 33
<https://github.com/mozilla/addon-sdk/pull/33>, I reviewed the changes
(comprising two
<https://github.com/toolness/jetpack-sdk/commit/97619b0b25554712756827...>
commits
<https://github.com/toolness/jetpack-sdk/commit/405390a586f6c09bad2b26...>)
on GitHub, and then I pushed them to the canonical repository via the
following set of commands:

   1. git checkout -b toolness-4.0b7-bustage-fixes master
   2. git pull https://github.com/toolness/jetpack-sdk.git
      4.0b7-bustage-fixes
   3. git checkout master
   4. git merge toolness-4.0b7-bustage-fixes
   5. git push upstream master

That landed the two
<https://github.com/mozilla/addon-sdk/commit/97619b0b25554712756827de8...>
commits
<https://github.com/mozilla/addon-sdk/commit/405390a586f6c09bad2b26183...>
in the canonical repository, but it isn't obvious that they were related
(i.e. part of the same pull request), that I was the one who reviewed
them, or that I was the one who pushed them.

Part 2: Wherein I Handle My Second Pull Request

Thus, for the fix for bug 611042
<https://bugzilla.mozilla.org/show_bug.cgi?id=611042>, for which Atul
submitted GitHub pull request 34
<https://github.com/mozilla/addon-sdk/pull/34>, I again reviewed the
changes (also comprising two
<https://github.com/toolness/jetpack-sdk/commit/5e6ca0e1834e65623f6ac8...>
commits
<https://github.com/toolness/jetpack-sdk/commit/1ab9c78c94fb08610460ad...>)
on GitHub, but then I pushed them to the canonical repository
<https://github.com/mozilla/addon-sdk> via this different set of
commands (after discussion with Atul and Patrick Walton of the Rust team):

   1. git checkout -b toolness-bug-611042 master
   2. git pull https://github.com/toolness/jetpack-sdk.git bug-611042
   3. (There might have been something else here, since the pull request
      resulted in a merge; I don't quite remember.)
   4. git checkout master
   5. git merge --no-ff --no-commit toolness-bug-611042
   6. git commit --signoff -m "bug 611042: remove request.response.xml
      for e10s compatibility; r=myk" --author "atul"
   7. git push upstream master

Because Atul's pull request was no longer against the tip (since I had
just merged those previous changes), when I pulled the remote bug-611042
branch into my local toolness-bug-611042 branch (step 2), I had to merge
his changes, which resulted in a merge commit
<https://github.com/mozilla/addon-sdk/commit/6a3c9e2a614f29b61e580a7a7...>.

Merging the changes to my local master with "--no-ff" and "--no-commit"
(step 5) then allowed me to commit the merge to my master branch
manually (step 6), resulting in another merge commit
<https://github.com/mozilla/addon-sdk/commit/9f202a3003cddace040bc695a...>.

For the second merge commit, I specified "--signoff", which added
"Signed-off-by: Myk Melez <m...@mozilla.org>" to the commit message;
crafted a custom commit message that included "r=myk"; and specified
'--author "atul"', which made Atul the author of the merge.

I dislike having the former merge commit in history, since it's
extraneous, unuseful details about how I did the merging locally before
I pushed to the canonical repository. I'm not sure how to avoid it, though.

On the other hand, I like having the latter merge commit in history,
since it provides context for Atul's two
<https://github.com/mozilla/addon-sdk/commit/5e6ca0e1834e65623f6ac87d3...>
commits
<https://github.com/mozilla/addon-sdk/commit/1ab9c78c94fb08610460ad19f...>:
the bug number, the fact that the changes were reviewed, and a commit
message that describes the changes as a whole.

I'm ambivalent about --signoff vs. adding "r=myk" to the commit message,
as they seem equivalentish, with --signoff being more explicit (so in
theory it might form part of an enlightened workflow in the future),
while "r=myk" is simpler.

And I dislike having made Atul the author of the merge, since it's
incorrect: he wasn't the author of the merge, he was only the author of
the changes (for which he is correctly credited). And if the merge
itself caused problems (f.e. I accidentally backed out other recent
changes in the process), I would be the one responsible for fixing those
problems, not Atul.

Part 3: Pushing Patches

In addition to pull requests, one can also contribute via patches. I've
pushed a few of these via something like the following set of commands:

   1. git apply patch.diff
   2. git commit -a -m "bug <number>: <description of changes>; r=myk"
      --author "<author name>"
   3. git push upstream master

That results in a commit like this one
<https://github.com/mozilla/addon-sdk/commit/026b4e8e78336c2dbbf30edb1...>,
which shows me as the committer and the patch author as the author. And
that seems like a fine record of what happened.

Part 4: To Bug or Not To Bug?

One of the questions GitHub raises is whether or not every change
deserves a bug report. And if not, how do we differentiate those that do
from the rest?

I don't have the definitive answers to these questions, but my sense,
from my experience so far, is that we shouldn't require all changes to
be accompanied by bug reports, but larger, riskier, time-consuming,
and/or controversial changes should have reports to capture history,
provide a forum for discussion, and permit project planning; while bug
reports should be optional for smaller, safer, quickly-resolved, and/or
non-controversial changes.

Thoughts?

-myk


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Erik Vold  
View profile  
 More options Nov 13 2010, 12:03 am
From: Erik Vold <erikvv...@gmail.com>
Date: Fri, 12 Nov 2010 21:03:52 -0800
Local: Sat, Nov 13 2010 12:03 am
Subject: Re: [jetpack] some Git workflow experiences

Hey Myk,

Some people prefer a strictly linear history, and you can do that with git.
Others like to see branches and merges in the history, and you can do that
with git. Others like to have the best of both worlds, and git lets you do
that too. I like to see a merged branch of related commits made to
accomplish a set of goals (or a single goal) in the history of a project. If
however a branch has only a single commit (or I choose to reduce it to a
single commit) then I'll cherry pick it. If a branch is made of commits that
accomplish different goals then I would rebase it on to master, though I
don't see that kind of branch often.

I'm guessing you want to see branches being merged in the history, based on
your part 2 attempt. I like to do pulls this way because it captures more of
the history, and makes it easier to understand.

Part 2: Wherein I Handle My Second Pull Request

> Thus, for the fix for bug 611042<https://bugzilla.mozilla.org/show_bug.cgi?id=611042>,
> for which Atul submitted GitHub pull request 34<https://github.com/mozilla/addon-sdk/pull/34>,
> I again reviewed the changes (also comprising two<https://github.com/toolness/jetpack-sdk/commit/5e6ca0e1834e65623f6ac8...>
> commits<https://github.com/toolness/jetpack-sdk/commit/1ab9c78c94fb08610460ad...>)
> on GitHub, but then I pushed them to the canonical repository<https://github.com/mozilla/addon-sdk>via this different set of commands (after discussion with Atul and Patrick
> Walton of the Rust team):

>    1. git checkout -b toolness-bug-611042 master
>    2. git pull https://github.com/toolness/jetpack-sdk.git bug-611042

> Danger Myk Melez! Danger!

Doing a git pull is the same as doing a git fetch and then a git merge. The
git merge is not what you want here.

>    1. (There might have been something else here, since the pull request
>    resulted in a merge; I don't quite remember.)
>     2. git checkout master
>    3. git merge --no-ff --no-commit toolness-bug-611042
>    4. git commit --signoff -m "bug 611042: remove request.response.xml for
>    e10s compatibility; r=myk" --author "atul"
>    5. git push upstream master

> What you want to do is checkout the commit that atul's branch points

to, (if there will be conflicts then I suggest merging your master branch to
atul's branch here, handle conflicts, commit, then procede in order to keep
the blame correct and the merge to master conflict free) merge that to your
master branch and then push your master branch upstream.

There are a number of ways to "checkout atul's branch" here are the two I've
used, there's probably a easier way (there always seems to be):

1) - git fetch atul
    - git checkout -b newBranchName sha1OfTheTipOfAtulsBranch

2) - git fetch persons_name
branch_name:refs/remotes/persons_name/branch_name
    - git checkout -t persons_name/branch_name

Because Atul's pull request was no longer against the tip (since I had just

Yah they suck; a nice feature of git is that you can fix the history, and
without much trouble usually, so if you really want to correct it then you
can, but it may not be worth it, because it will mean everyone that has
forked it will need to do some fancy git work to be in sync with upstream
again. It's not that hard to do though, especially since the code wouldn't
change in this case, and it's something that all gits should learn to deal
with imo.

On the other hand, I like having the latter merge commit in history, since

> it provides context for Atul's two<https://github.com/mozilla/addon-sdk/commit/5e6ca0e1834e65623f6ac87d3...>
> commits<https://github.com/mozilla/addon-sdk/commit/1ab9c78c94fb08610460ad19f...>:
> the bug number, the fact that the changes were reviewed, and a commit
> message that describes the changes as a whole.

> I'm ambivalent about --signoff vs. adding "r=myk" to the commit message, as
> they seem equivalentish, with --signoff being more explicit (so in theory it
> might form part of an enlightened workflow in the future), while "r=myk" is
> simpler.

And I dislike having made Atul the author of the merge, since it's

> incorrect: he wasn't the author of the merge, he was only the author of the
> changes (for which he is correctly credited). And if the merge itself caused
> problems (f.e. I accidentally backed out other recent changes in the
> process), I would be the one responsible for fixing those problems, not
> Atul.

The person doing the merge should be the author of a merge commit, I agree;
this way the proper person is given credit+blame for handling conflicts if
there were any.

Part 4: To Bug or Not To Bug?

> One of the questions GitHub raises is whether or not every change deserves
> a bug report. And if not, how do we differentiate those that do from the
> rest?

> I don't have the definitive answers to these questions, but my sense, from
> my experience so far, is that we shouldn't require all changes to be
> accompanied by bug reports, but larger, riskier, time-consuming, and/or
> controversial changes should have reports to capture history, provide a
> forum for discussion, and permit project planning; while bug reports should
> be optional for smaller, safer, quickly-resolved, and/or non-controversial
> changes.

Sounds reasonable to me.

--
Erik Vergobbi Vold

Email: erikvv...@gmail.com
Website: http://erikvold.com/
Twitter: http://twitter.com/erikvold
Identi.ca: http://identi.ca/erikvold
LinkedIn: http://www.linkedin.com/in/erikvold


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Erik Vold  
View profile  
 More options Nov 13 2010, 12:54 pm
From: Erik Vold <erikvv...@gmail.com>
Date: Sat, 13 Nov 2010 09:54:58 -0800
Local: Sat, Nov 13 2010 12:54 pm
Subject: Re: [jetpack] some Git workflow experiences

On Fri, Nov 12, 2010 at 21:03, Erik Vold <erikvv...@gmail.com> wrote:
> There are a number of ways to "checkout atul's branch" here are the two
> I've used, there's probably a easier way (there always seems to be):

> 1) - git fetch atul
>     - git checkout -b newBranchName sha1OfTheTipOfAtulsBranch

This works too: git checkout -b new_branch_name atul/branch_name

Erik


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Erik Vold  
View profile  
 More options Nov 13 2010, 5:03 pm
From: Erik Vold <erikvv...@gmail.com>
Date: Sat, 13 Nov 2010 14:03:30 -0800
Local: Sat, Nov 13 2010 5:03 pm
Subject: Re: [jetpack] some Git workflow experiences

On Fri, Nov 12, 2010 at 21:03, Erik Vold <erikvv...@gmail.com> wrote:
> What you want to do is checkout the commit that atul's branch points
> to, (if there will be conflicts then I suggest merging your master branch to
> atul's branch here, handle conflicts, commit, then procede in order to keep
> the blame correct and the merge to master conflict free) merge that to your
> master branch and then push your master branch upstream.

when I said merge here, I meant merge --no-ff

Erik


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Dietrich Ayala  
View profile  
 More options Nov 16 2010, 9:22 am
From: Dietrich Ayala <auton...@gmail.com>
Date: Tue, 16 Nov 2010 21:22:07 +0700
Local: Tues, Nov 16 2010 9:22 am
Subject: Re: [jetpack] some Git workflow experiences
Was there anything that changed from the steps for these things in
your post, due to this thread?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Irakli Gozalishvili  
View profile  
 More options Nov 18 2010, 6:00 am
From: Irakli Gozalishvili <rfo...@gmail.com>
Date: Thu, 18 Nov 2010 12:00:57 +0100
Local: Thurs, Nov 18 2010 6:00 am
Subject: Re: [jetpack] some Git workflow experiences

Hi Myk,

Erik mentioned all most of it but let me jest post reduced snippet that does
the same, except making atul an an author of a merge.

1. git remote add atul  https://github.com/toolness/jetpack-sdk.git #this is
one time only
2. git fetch atul
3. git merge atul/toolness-bug-611042 --no-ff -m 'bug 611042: remove
request.response.xml for e10s compatibility; r=myk'
4. git push upstream master

Assuming that when you run this comments your are on master and in sync with
upstream.

Because Atul's pull request was no longer against the tip (since I had just

I dislike having the former merge commit in history, since it's extraneous,
> unuseful details about how I did the merging locally before I pushed to the
> canonical repository. I'm not sure how to avoid it, though.

You can add --amend to the commit and it will just add your changes to the
last commit. I would still recommend to stick to the flaw I've posted above
since it won't require manual commits and will keep history clean.

I totally agree and in fact I don't think that you should be adding --author
"atul". In history it will be pretty clear anyway that changes are done are
done by Atul and merged & pushed by you:

git log --oneline --graph

Or some visual tool like gitk will do a great job here.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Myk Melez  
View profile  
 More options Nov 23 2010, 9:06 pm
From: Myk Melez <m...@mozilla.org>
Date: Tue, 23 Nov 2010 18:06:20 -0800
Local: Tues, Nov 23 2010 9:06 pm
Subject: Re: [jetpack] some Git workflow experiences

On 11/18/2010 03:00 AM, Irakli Gozalishvili wrote:

> Erik mentioned all most of it but let me jest post reduced snippet
> that does the same, except making atul an an author of a merge.

> 1. git remote add atul
> https://github.com/toolness/jetpack-sdk.git #this is one time only
> 2. git fetch atul
> 3. git merge atul/toolness-bug-611042 --no-ff -m 'bug 611042: remove
> request.response.xml for e10s compatibility; r=myk'
> 4. git push upstream master

Thanks Erik and Irakli, this is really helpful!

With a tip from Brian and a bit more experimentation (looking for ways
to simplify as much as possible), here is where I'm currently at:

   1.  From the "how to merge this pull request" section of the pull
      request page (f.e. pull request 34
      <https://github.com/mozilla/addon-sdk/pull/43>), copy the command
      from step two, but change the word "pull" to "fetch", f.e.:

      |git fetch https://github.com/toolness/jetpack-sdk.git bug-610507

      |
   2. Merge the remote branch into the local master branch with a custom
      commit message:

      git merge FETCH_HEAD --no-ff -m"bug 610507: get rid of the
      nsjetpack package; r=myk"

   3. Push the changes upstream:

      git push upstream master

I like this set of commands because it doesn't require me to add a
remote, I can copy/paste the fetch command from GitHub (although I have
to be careful not to copy a line break character along with it and issue
a pull before I have had a chance to change it to a fetch), and I always
type the same alias to the branch name in step three.

However, I wish the merge commit page
<https://github.com/mozilla/addon-sdk/commit/0e23d1c1555d5de228ed7ad62...>
referenced the specific
<https://github.com/mozilla/addon-sdk/commit/68b6e306dfeccef103b071e08...>
commits
<https://github.com/mozilla/addon-sdk/commit/715cb47c720bcdd11846cae6c...>
that were merged. It does mention that it's a branch merge, but there's
no way to get from that page to the pages for the commits I merged from
the branch.

"git log --oneline --graph", gitg, and gitk do give me that information,
though, so I'm ok on the command line, anyway.

-myk


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Myk Melez  
View profile  
 More options Nov 23 2010, 9:26 pm
From: Myk Melez <m...@mozilla.org>
Date: Tue, 23 Nov 2010 18:26:42 -0800
Local: Tues, Nov 23 2010 9:26 pm
Subject: Re: [jetpack] some Git workflow experiences

On 11/23/2010 06:06 PM, Myk Melez wrote:

One more tip from Brian! Between steps one and two, verify that the set
of changes is as you expect with "git diff FETCH_HEAD HEAD".

And in step two, you could merge and commit separately to use --signoff,
such as I did for pull request 44
<https://github.com/mozilla/addon-sdk/pull/44>:

$ git merge FETCH_HEAD --no-ff --no-commit
Automatic merge went well; stopped before committing as requested
$ git commit -m"Bug 613341 - addons should be marked as compatible with
4.0b8pre" --signoff
[master b1d60f5] Bug 613341 - addons should be marked as compatible with
4.0b8pre

But that results in this merge commit that doesn't look like a merge
commit
<https://github.com/mozilla/addon-sdk/commit/b1d60f594376c22b9b1ff83a8...>
along with the original change
<https://github.com/mozilla/addon-sdk/commit/5f29e85df03386aa285b29e33...>.
So I don't like that as much.

-myk


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Erik Vold  
View profile  
 More options Nov 23 2010, 10:09 pm
From: Erik Vold <erikvv...@gmail.com>
Date: Tue, 23 Nov 2010 19:09:45 -0800
Local: Tues, Nov 23 2010 10:09 pm
Subject: Re: [jetpack] some Git workflow experiences

I like it, but if there are conflicts to resolve then this would result in a
merge commit on master with conflict resolutions, which I dislike.

A merge commit has two parent commits (which make them obvious), and github
links to both of them. 68b6e306dfeccef103b071e0812dc3a375830ac0 is not a
parent of 0e23d1c1555d5de228ed7ad62c8715e2775d2390 though.

> It does mention that it's a branch merge, but there's no way to get from
> that page to the pages for the commits I merged from the branch.

> "git log --oneline --graph", gitg, and gitk do give me that information,
> though, so I'm ok on the command line, anyway.

> -myk

> --

Erik Vergobbi Vold

Email: erikvv...@gmail.com
Website: http://erikvold.com/
Twitter: http://twitter.com/erikvold
Identi.ca: http://identi.ca/erikvold
LinkedIn: http://www.linkedin.com/in/erikvold


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Erik Vold  
View profile  
 More options Nov 23 2010, 10:11 pm
From: Erik Vold <erikvv...@gmail.com>
Date: Tue, 23 Nov 2010 19:11:39 -0800
Local: Tues, Nov 23 2010 10:11 pm
Subject: Re: [jetpack] some Git workflow experiences

I like to make a normal commit, and then make my modifications to it
afterward with git commit --amend ...

--
Erik Vergobbi Vold

Email: erikvv...@gmail.com
Website: http://erikvold.com/
Twitter: http://twitter.com/erikvold
Identi.ca: http://identi.ca/erikvold
LinkedIn: http://www.linkedin.com/in/erikvold


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jean-Marc Desperrier  
View profile  
 More options Nov 29 2010, 6:31 pm
From: Jean-Marc Desperrier <jmd...@gmail.com>
Date: Mon, 29 Nov 2010 15:31:29 -0800 (PST)
Local: Mon, Nov 29 2010 6:31 pm
Subject: Re: some Git workflow experiences
On 24 nov, 04:09, Erik Vold <erikvv...@gmail.com> wrote:

> On Tue, Nov 23, 2010 at 18:06, Myk Melez <m...@mozilla.org> wrote:
> > However, I wish the merge commit page<https://github.com/mozilla/addon-sdk/commit/0e23d1c1555d5de228ed7ad62...>referenced the
> > specific<https://github.com/mozilla/addon-sdk/commit/68b6e306dfeccef103b071e08...>
> > commits<https://github.com/mozilla/addon-sdk/commit/715cb47c720bcdd11846cae6c...>that were merged.

> A merge commit has two parent commits (which make them obvious), and github
> links to both of them. 68b6e306dfeccef103b071e0812dc3a375830ac0 is not a
> parent of 0e23d1c1555d5de228ed7ad62c8715e2775d2390 though.

I don't see what Myk expected to be another way, I think he got a
little confused.
The branch/tail he was merging https://github.com/mozilla/addon-sdk/pull/43
had two patches, where 715cb47c720bcdd11846cae6c6cab325bb1a982b was
applied above the older one 68b6e306dfeccef103b071e0812dc3a375830ac0
The 0e23d1c1555d5de228ed7ad62... commit does show
715cb47c720bcdd11846cae6c6cab325bb1a982b as one of the 2 tails that
were merged.
To see the other patches from that merged branch you must go up from
there. If you go to 715cb47c720bcdd11846cae6c6cab325bb1a982b, you do
see 68b6e306dfeccef103b071e0812dc3a375830ac0 as it's parent

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »