Bug 28721 - WebKit needs a git-merge-changelogs
Summary: WebKit needs a git-merge-changelogs
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC OS X 10.5
: P2 Normal
Assignee: Tor Arne Vestbø
URL:
Keywords:
Depends on:
Blocks: 34206
  Show dependency treegraph
 
Reported: 2009-08-25 15:25 PDT by Eric Seidel (no email)
Modified: 2010-02-18 07:56 PST (History)
7 users (show)

See Also:


Attachments
first try (27.81 KB, patch)
2010-02-05 02:14 PST, Tor Arne Vestbø
no flags Details | Formatted Diff | Diff
without all those gitattributes and changelogs (5.80 KB, patch)
2010-02-05 05:41 PST, Tor Arne Vestbø
no flags Details | Formatted Diff | Diff
Patch (5.13 KB, patch)
2010-02-17 01:47 PST, Tor Arne Vestbø
eric: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Seidel (no email) 2009-08-25 15:25:42 PDT
WebKit needs a git-merge-changelogs

Git has the ability to specify custom merge drivers on a per-file basis.
See "man gitattributes" or http://www.kernel.org/pub/software/scm/git/docs/gitattributes.html for more information.

the gnu folks over at gnulib have already written a git-merge-changelog:
http://cyberelk.net/tim/2008/05/29/git-merge-changelog/

Sadly, it's in C, and has a bunch of dependencies on gnu stuff.  It's also GPL'd.


Another kink is that although it's possible to edit the root ".gitattributes" file and check in a mapping from "ChangeLog" to a specific merge driver, merge drivers have to be defined in a git config file, which must be either in .git/config or ~/.gitconfig. :(  So we'd have to have an installer to set up using a git-merge-changelog script if we wrote one.  That should be easy since "git config" already handles reading/writing from .git/config files nicely.

I looked briefly at writing this today.  The merge driver is passed paths to 3 temp files.  1. previous version 2. other branch version.  3.  this branch version.  Maybe one of the other WebKit git users will get further than I did.
Comment 1 Tor Arne Vestbø 2010-01-27 01:58:47 PST
Relates to bug 34206
Comment 2 Tor Arne Vestbø 2010-01-28 02:08:27 PST
I'll start looking at this now, if anyone has made any progress please post patches here.

I don't think the bootstrapping-part would be too much trouble, ie telling people do do 'git config merge.changelog.name Foo' or running an install-script, since most of our tools are already wrapper-scripts or helper-scripts that require knowledge about their existence and how to use them, ie they are not "automatic" in any way.
Comment 3 Chris Jerdonek 2010-01-28 02:11:22 PST
(In reply to comment #2)
> I'll start looking at this now, if anyone has made any progress please post
> patches here.
> 
> I don't think the bootstrapping-part would be too much trouble, ie telling
> people do do 'git config merge.changelog.name Foo' or running an
> install-script, since most of our tools are already wrapper-scripts or
> helper-scripts that require knowledge about their existence and how to use
> them, ie they are not "automatic" in any way.

Thanks, Tor!

FYI, we are already telling people to do a few "git config" statements--

http://trac.webkit.org/wiki/UsingGitWithWebKit#WebKitScriptsupportforGit

so I'm sure that adding another one or two won't hurt -- as they are already familiar with doing that:
Comment 4 David Kilzer (:ddkilzer) 2010-01-29 16:29:24 PST
(In reply to comment #2)
> I'll start looking at this now, if anyone has made any progress please post
> patches here.

I thought I had a local branch with some related changes, but it seems that I do not.  Sorry.
Comment 5 Tor Arne Vestbø 2010-02-05 02:14:45 PST
Created attachment 48214 [details]
first try

First try, will run this locally for a few days to test before r?
Comment 6 Tor Arne Vestbø 2010-02-05 05:21:47 PST
Apparently we don't need all those .gitattributes, just one root level file, I'll fix that in a new patch
Comment 7 Tor Arne Vestbø 2010-02-05 05:41:01 PST
Created attachment 48227 [details]
without all those gitattributes and changelogs
Comment 8 Tor Arne Vestbø 2010-02-17 01:47:57 PST
Created attachment 48871 [details]
Patch
Comment 9 Tor Arne Vestbø 2010-02-17 01:50:11 PST
Note that if the user has not defined merge.changelog.driver, git is going to ignore the .gitattribute instruction and just try to merge it itself, so there won't be any "missing driver" messages (as far as I know).
Comment 10 Eric Seidel (no email) 2010-02-17 10:15:55 PST
Comment on attachment 48871 [details]
Patch

LGTM.
Comment 11 Tor Arne Vestbø 2010-02-18 07:52:16 PST
Landed in r54960
Comment 12 Tor Arne Vestbø 2010-02-18 07:56:19 PST
Added an entry to https://trac.webkit.org/wiki/UsingGitWithWebKit about this feature too.