New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to generate and insert a Gerrit Change-Id into the commit message #219

Closed
svogt opened this Issue Aug 8, 2014 · 0 comments

Comments

Projects
None yet
2 participants
@svogt
Collaborator

svogt commented Aug 8, 2014

In order to push to a Gerrit instance a Change-Id might be required.

JGit has a utility for that: http://git.eclipse.org/c/jgit/jgit.git/tree/org.eclipse.jgit/src/org/eclipse/jgit/util/ChangeIdUtil.java

For general documentation see: https://gerrit-review.googlesource.com/Documentation/user-changeid.html

For C-Git the following hook is typically used:

_gen_ChangeIdInput() {
    echo "tree `git write-tree`"
    if parent=`git rev-parse "HEAD^0" 2>/dev/null`
    then
        echo "parent $parent"
    fi
    echo "author `git var GIT_AUTHOR_IDENT`"
    echo "committer `git var GIT_COMMITTER_IDENT`"
    echo
    printf '%s' "$clean_message"
}
_gen_ChangeId() {
    _gen_ChangeIdInput |
    git hash-object -t commit --stdin
}

@svogt svogt added the feature label Aug 8, 2014

@jutzig jutzig added this to the 1.1.3 milestone Aug 11, 2014

@jutzig jutzig closed this in 6a31b68 Aug 11, 2014

@jutzig jutzig assigned svogt and jutzig and unassigned svogt Dec 12, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment