[ 
https://issues.apache.org/jira/browse/HBASE-12387?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14191827#comment-14191827
 ] 

Sean Busbey commented on HBASE-12387:
-------------------------------------

If we want to do that we'll need to expand the committer guidelines to cover 
setting things up.

Something like

{quote}
This example shows how to commit a patch that was created using git diff 
without --no-prefix. If the patch was created with --no-prefix, add -p0 to the 
git apply command. *Before following these steps, you must ensure your working 
directory is clean.* Otherwise, the autocommit step (commit -a) will coalesce 
your local changes with those of the contributor.

Note that unlike the case of a patch made with git format-patch, the patch 
itself doesn't include information on the contributor. Normally, you should be 
able to use the name and email address from the user's ASF Jira account to fill 
in the author details, below we use the example "Prathia Hall 
<prathia.h...@example.com>".

{code}
$ git apply ~/Downloads/HBASE-XXXX-v2.patch 
$ git commit -m "HBASE-XXXX Really Good Code" --author "Prathia Hall 
<prathia.h...@example.com>" \
    --signoff -a # This extra step is needed for patches created with 'git diff'
$ git checkout master
$ git pull --rebase
$ git cherry-pick <sha-from-commit>
# Resolve conflicts if necessary or ask the submitter to do it
$ git pull --rebase          # Better safe than sorry
$ git push origin master
$ git checkout branch-1
$ git pull --rebase
$ git cherry-pick <sha-from-commit>
# Resolve conflicts if necessary or ask the submitter to do it
$ git pull --rebase           # Better safe than sorry
$ git push origin branch-1
$ git branch -D HBASE-XXXX
{code}
{quote}

Actually, that's not that much more work. But it sounds like enough of a change 
to warrant a DISCUSS thread?

> committer guidelines should include patch signoff
> -------------------------------------------------
>
>                 Key: HBASE-12387
>                 URL: https://issues.apache.org/jira/browse/HBASE-12387
>             Project: HBase
>          Issue Type: Task
>          Components: documentation
>            Reporter: Sean Busbey
>
> Right now our guide for committers apply patches has them use {{git am}} 
> without a signoff flag. This works okay, but it misses adding the 
> "signed-off-by" blurb in the commit message.
> Those messages make it easier to see at a glance with e.g. {{git log}} which 
> committer applied the patch.
> this section:
> {quote}
> The directive to use git format-patch rather than git diff, and not to use 
> --no-prefix, is a new one. See the second example for how to apply a patch 
> created with git diff, and educate the person who created the patch.
> {code}
> $ git checkout -b HBASE-XXXX
> $ git am ~/Downloads/HBASE-XXXX-v2.patch
> $ git checkout master
> $ git pull --rebase
> $ git cherry-pick <sha-from-commit>
> # Resolve conflicts if necessary or ask the submitter to do it
> $ git pull --rebase          # Better safe than sorry
> $ git push origin master
> $ git checkout branch-1
> $ git pull --rebase
> $ git cherry-pick <sha-from-commit>
> # Resolve conflicts if necessary
> $ git pull --rebase          # Better safe than sorry
> $ git push origin branch-1
> $ git branch -D HBASE-XXXX
> {code}
> {quote}
> Should be
> {quote}
> The directive to use git format-patch rather than git diff, and not to use 
> --no-prefix, is a new one. See the second example for how to apply a patch 
> created with git diff, and educate the person who created the patch.
> Note that the {{--signoff}} flag to {{git am}} will insert a line in the 
> commit message that the patch was checked by your author string. This 
> addition to your inclusion as the commit's committer makes your participation 
> more prominent to users browsing {{git log}}.
> {code}
> $ git checkout -b HBASE-XXXX
> $ git am --signoff ~/Downloads/HBASE-XXXX-v2.patch
> $ git checkout master
> $ git pull --rebase
> $ git cherry-pick <sha-from-commit>
> # Resolve conflicts if necessary or ask the submitter to do it
> $ git pull --rebase          # Better safe than sorry
> $ git push origin master
> $ git checkout branch-1
> $ git pull --rebase
> $ git cherry-pick <sha-from-commit>
> # Resolve conflicts if necessary
> $ git pull --rebase          # Better safe than sorry
> $ git push origin branch-1
> $ git branch -D HBASE-XXXX
> {code}
> {quote}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to