git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: git: avoiding merges, rebasing

From
Benoit SIGOURE <tsuna@lrde.epita.fr>
Date
Oct 8, 2007, 13:17 UTC
Message-ID
<07BCEF3E-90DE-4BB7-8A8C-F03D12293B5F@lrde.epita.fr>
In-Reply-To
<C64152A3-A5A6-4320-864C-E78E3A60C8E6@lrde.epita.fr>
[as usual, I forgot the attachment...]
On Sep 30, 2007, at 10:27 PM, Benoit SIGOURE wrote:
Show 18 quoted lines
> On Sep 30, 2007, at 9:41 PM, Bruno Haible wrote:
>
>>> it should be
>>> possible to create a custom [merge "cl-merge"] in your git config  
>>> file,
>>> which points to a script designed specifically for resolving  
>>> changelog
>>> conflicts
>>
>> I would love such a script, instead of constantly having to do  
>> conflict
>> resolution at the top of ChangeLog.
>>
>
> So would I.  I've had this in my TODO list for a long time so if no  
> one else is willing to give it a try, I can try, but it won't be  
> before next week because my schedule is quite busy until then.
>

I finally found some time to hack something and here is my git-merge- changelog Perl script. I tested it quickly and it seems to work fine. It will mess up the ChangeLog entries when a commit actually modifies an existing ChangeLog entry. It needs more testing but I'm just throwing this out in the wild for people that have interest in this to review. I will eventually come up with a solution for the commits modifying existing entries and a testsuite.

I'm CC-ing the Git ML just in case it interests some more people over there.

In order to use it, add the following to your ~/.gitconfig:
[merge "cl-merge"]
         name = GNU-style ChangeLog merge driver
         driver = /path/to/git-merge-changelog %O %A %B
(you can also add it to a specific working copy by adding it in .git/ 
config instead)

Then, in the directory where the ChangeLog is, add a .gitattributes file with the following content: ChangeLog merge=cl-merge

For more information, see man gitattributes.
Let me know if something goes wrong.
Cheers,
-- 
Benoit Sigoure aka Tsuna
EPITA Research and Development Laboratory
Previous: Benoit SIGOURENext: Johannes Schindelin
Message 10 of 15 in “Re: git: avoiding merges, rebasing”
  1. Eric BlakeOct 2, 2007
  2. making "git stash" safer to useBruno Haible, Oct 3, 2007
  3. Junio C HamanoOct 3, 2007
  4. Joachim B HagaOct 4, 2007
  5. David KastrupOct 4, 2007
  6. stash clear, was Re: git: avoiding merges, rebasingJohannes Schindelin, Oct 19, 2007
  7. Miles BaderOct 23, 2007
  8. Bruno HaibleOct 3, 2007
  9. Benoit SIGOUREOct 8, 2007
  10. Benoit SIGOUREOct 8, 2007
  11. Johannes SchindelinOct 9, 2007
  12. Benoit SIGOUREOct 9, 2007
  13. Bruno HaibleOct 9, 2007
  14. GNU-style ChangeLog merge driver for Git (was: Re: git: avoiding merges, rebasing)Benoit SIGOURE, Oct 9, 2007
  15. Bruno HaibleOct 9, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.