how to edit the merge commit message?

720 views
Skip to first unread message

Alex Jewel

unread,
Feb 17, 2023, 2:14:04 AM2/17/23
to Repo and Gerrit Discussion
Hi

I am using "Merge if necessary" merge strategy in gerrit, the merge commit messages are like "Merge XYZ into ABC" which is actually confusing.

 I'd like the merge commit message to be the exactly the same including formatting
(like new lines etc) as the actual commit being merged, is there way to accomplish this?


Edwin Kempin

unread,
Feb 17, 2023, 2:17:27 AM2/17/23
to Alex Jewel, Repo and Gerrit Discussion
No, I don't think this is possible with what we have.
Why don't you use the Rebase If Necessary submit strategy instead that retains the original commit message?

 


--
--
To unsubscribe, email repo-discuss...@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en

---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/repo-discuss/0ff33441-d380-4917-8837-73f2f6140f0dn%40googlegroups.com.

Alex Jewel

unread,
Feb 17, 2023, 10:29:01 AM2/17/23
to Repo and Gerrit Discussion
On Thursday, 16 February 2023 at 23:17:27 UTC-8 Edwin Kempin wrote:
On Fri, Feb 17, 2023 at 8:14 AM Alex Jewel <itsch...@gmail.com> wrote:
Hi

I am using "Merge if necessary" merge strategy in gerrit, the merge commit messages are like "Merge XYZ into ABC" which is actually confusing.

 I'd like the merge commit message to be the exactly the same including formatting
(like new lines etc) as the actual commit being merged, is there way to accomplish this?

No, I don't think this is possible with what we have.
Why don't you use the Rebase If Necessary submit strategy instead that retains the original commit message?
I need to preserve the history of my repo ,so I need to be on merge strategy.
 is there any way the merge commit message is configurable and can be formatted in gerrit?for lengthy  formatted commit messages in the original commit, merge commit really messes up the formatting removing newlines ,truncating the original commit message, anyway to make the merge commit messages more readable?

Alex Jewel

unread,
Feb 17, 2023, 7:04:06 PM2/17/23
to Repo and Gerrit Discussion
On Friday, 17 February 2023 at 07:29:01 UTC-8 Alex Jewel wrote:
On Thursday, 16 February 2023 at 23:17:27 UTC-8 Edwin Kempin wrote:
On Fri, Feb 17, 2023 at 8:14 AM Alex Jewel <itsch...@gmail.com> wrote:
Hi

I am using "Merge if necessary" merge strategy in gerrit, the merge commit messages are like "Merge XYZ into ABC" which is actually confusing.

 I'd like the merge commit message to be the exactly the same including formatting
(like new lines etc) as the actual commit being merged, is there way to accomplish this?

No, I don't think this is possible with what we have.
Why don't you use the Rebase If Necessary submit strategy instead that retains the original commit message?
I need to preserve the history of my repo ,so I need to be on merge strategy.
 is there any way the merge commit message is configurable and can be formatted in gerrit?for lengthy  formatted commit messages in the original commit, merge commit really messes up the formatting removing newlines ,truncating the original commit message, anyway to make the merge commit messages more readable?

Does the below plugin help ,annnotating notes to merge commits?

Edwin Kempin

unread,
Feb 20, 2023, 2:25:06 AM2/20/23
to Alex Jewel, Repo and Gerrit Discussion
On Sat, Feb 18, 2023 at 1:04 AM Alex Jewel <itsch...@gmail.com> wrote:


On Friday, 17 February 2023 at 07:29:01 UTC-8 Alex Jewel wrote:
On Thursday, 16 February 2023 at 23:17:27 UTC-8 Edwin Kempin wrote:
On Fri, Feb 17, 2023 at 8:14 AM Alex Jewel <itsch...@gmail.com> wrote:
Hi

I am using "Merge if necessary" merge strategy in gerrit, the merge commit messages are like "Merge XYZ into ABC" which is actually confusing.

 I'd like the merge commit message to be the exactly the same including formatting
(like new lines etc) as the actual commit being merged, is there way to accomplish this?

No, I don't think this is possible with what we have.
Why don't you use the Rebase If Necessary submit strategy instead that retains the original commit message?
I need to preserve the history of my repo ,so I need to be on merge strategy.
 is there any way the merge commit message is configurable and can be formatted in gerrit?

No, not that I know.
 
for lengthy  formatted commit messages in the original commit, merge commit really messes up the formatting removing newlines ,truncating the original commit message,

 
anyway to make the merge commit messages more readable?

We have an extension point that allows you to modify the commit message from a plugin, but it's only invoked for the Rebase If Necessary and Cherry-Pick submit strategies [1].
You may contribute a change to Gerrit to invoke this extension point also for Merge If Necessary.


 

Does the below plugin help ,annnotating notes to merge commits?


This plugin records additional metadata as git notes, it doesn't allow you to modify the commit message.


 


--
--
To unsubscribe, email repo-discuss...@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en

---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/repo-discuss/0ff33441-d380-4917-8837-73f2f6140f0dn%40googlegroups.com.

--
--
To unsubscribe, email repo-discuss...@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en

---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.

Björn Pedersen

unread,
Feb 20, 2023, 7:10:15 AM2/20/23
to Repo and Gerrit Discussion
Alex Jewel schrieb am Freitag, 17. Februar 2023 um 16:29:01 UTC+1:
I need to preserve the history of my repo ,so I need to be on merge strategy.

Which history due you want to preserve? All gerrit strategies keep the target branch history and always add  new commit on the head. Only the 'working branches'  aka  changes are  handled differently:

1: merge if necessary / merge always

  a  change is always  merged ( either with the  equivalent of  merge --ff or merge -no-ff)

an change series  that looks like :
 x -  y - z  ------    
        \-- c1 --c2

gives:  

 x -  y - z  ------     m1 --- 
        \-- c1 --c2--/


an change series  that looks like :
 x -  y - z  
             \-- c1 --c2

gives (merge if necessary only) :  

 x -  y - z  ---- c1 -- c2 

 
2: rebase if necessary / rebase always
  the change series is first rebased onto the target branch and then merged , resulting in fast-forward merge

an change series  that looks like :
 x -  y - z  ------    
        \-- c1 --c2

gives:  
x -  y - z - c1 - c2 


As the  recommend pratcice is to do a local rebase before pushing anyway, unless the repo is really busy the rebase will often be a noop  anyway.

3: cherry-pick:
 cherry-picks commits individually

an change series  that looks like :
 x -  y - z  ------    
        \-- c1 --c2

gives (submit only c2):
x -  y - z - c2 
     \ -- c1
 
Reply all
Reply to author
Forward
0 new messages