How to add descption to a given patchset in Gerrit? - gerrit

I can create new patchset to a given Gerrit without issues.
However, I would like to describe what the patchset is about. I have been doing that as part of the commit message, as I commit -amend and push the new patchset with the revised comment.
Is there a well defined way of describing the patchset in the commit message, so Gerrit can automatically set its description? The only mentioning of the description I found so far was from this page:
https://gerrit-review.googlesource.com/Documentation/concept-patch-sets.html#_description

Heh, looks like I found a potential answer for my own question. :)
If I encode the push command with a %m= I seem to be able to set the description for the patchset. It feels a little hacky, in that I need to replace
spaces with _ and percent encode characters as well.
That is described gerrit's documentation for code review.
Example:
git push ssh://john.doe#git.example.com:29418/kernel/common HEAD:refs/for/experimental%m=This_is_a_rebase_on_master%21
Any other/better way that you may know about?

Related

Need proper looking e-mail notification from Jenkins: including SVN changes made since last build and errors during buil, if any

Jenkins is used to poll SCM (SVN) using SVN plugin, then build using Ant/Maven/Gradle
In Post Build Actions, I`ve chosen Editable Email Notification, and under section of Triggers chose Always
And in Content section I have set the following tags (as is):
$PROJECT_DEFAULT_CONTENT
$CAUSE
$BUILD_LOG_REGEX
$CHANGES
Unfortunately it does not do what I want. First two is fine, but last two, I need them to send errors and warnings (only, not all the log), and what changes and in what particular files were made since last build.
Thank you.
Ok, no one answered, but I find solution for changes on my own:
${CHANGES, showPaths=true, format="%a: %r %p \n--\"%m\"", pathFormat="\n\t- %p"}
As for $BUILD_LOG_REGEX, now when I know format, I`ll find solution too some time later.

Bitbucket (pull request) comment deleted after update

My team and I just start with bitbucket. Also, we review our code now.
Now we noticed that after someone add a comment on a line (for example, "change code...") and the code is changed by the author like the comment said, the comment is deleted in the overview section.
Why is that? We only can find the comment back in the activity section.
We like to have a confirmation reply from the author after he changed his code.
Right now this appears to be common behaviour (at least in the Bitbucket Server version).
You can find an open issue for that in the Bitbucket Issue Tracker. I guess we need to vote for it to get its priority pushed: https://jira.atlassian.com/browse/BSERV-7534

Serve custom commit-msg hook from Gerrit

Gerrit comes with a default commit message hook to insert a Change-Id in the footer. The hook defines that the Change-Id should be inserted after Issue or Bug in the footer:
CHANGE_ID_AFTER="Bug|Issue"
Now I would like to modify this so it becomes:
CHANGE_ID_AFTER="Refs|Closes|Fixes"
This is because the issue tracker in use doesn't work with Bug or Issue but with an issue identifier starting with a #.
Now of course I can apply this locally but uniformity is desired across the complete development team. It would help a lot if Gerrit would serve this modified file.
I can't seem to find anything in Gerrit's docs that describes what I would like to achieve.
Since the hook is pulled in through scp I thought I might be able to upload a modified hook the same way. This of course didn't work.
I have administrative rights to Gerrit, so that can't be the issue.

link to other system issue number in gerrit code review page based on commit message

I used to write commit message to connect issue system like issue #9548, redmine start page is fixed, and wonder whether it can be written in hook or plugin in gerrit system.
So in the code review page, the issue #9548 can be automatically show the http link to my issues system (like redmine): => issue#9548,redmine start page is fixed
It will be easily for code review.
Yes, it is possible. In your Gerrit configuration, you have to provide a regex expression for the string in the commit message and the link to your bugtracker with wildcards. See the Gerrit documentation. For your example, you would have a regex like (issue\s+#?)(\d+)
If you use Jira and have your Jira case number first in the commit message, add the following to gerrit.config to get links when viewing change sets:
[commentlink "jira"]
match = "^([A-Z]*-[0-9]*)"
link = http://jira/browse/$1
Some supported commit message formats (paste into Rubular to test):
PRJ-123: This is my commit message
ABC-123 - Something: Yes yes
PROJ-123
ABCD-123 - Message
For more examples, see the Gerrit documentation on Section commentlink
Yes you can turn the issue tag into a link in Gerrit. Look at the commentlink configuration - http://gerrit-documentation.googlecode.com/svn/Documentation/2.2.0/config-gerrit.html#_a_id_commentlink_a_section_commentlink

Git - If we want to take a snapshot - should we Branch our should we Commit?

Let's say I'm working on this thing, and I want to preserve this state, so that, if something goes wrong, I can revert to it.
According to this, it's not clear to me:
What should we do when on this situation:
commit or create branch ?
I think Git Tag is what you are looking for.
http://git-scm.com/book/en/v2/Git-Basics-Tagging

Resources