On Sat, May 15, 2010 at 10:05:14PM -0500, Jonathan Nieder wrote:
> Josh Triplett wrote[1]:
> > I fairly often work on a commit with other people, and I want the
> > commit metadata to reflect that by showing multiple authors for one
> > commit.
> 
> This has come up a few times recently[2][3][4], with the best workaround
> suggested being Andreas’s
> 
>   Co-authored-by: Some One <[email protected]>

I do something similar; all my pair-programmed commits have a note at
the end of the commit message saying
Commit by Josh Triplett and Jamey Sharp.

I'd just like git to have real metadata for this case.

> As you mentioned, emails are allowed to have multiple authors, and
> there is no reason in principle some faraway future git version could
> not similarly handle them:
> 
>  1. Teach _everyone_ who parses git objects (in git.git and elsewhere)
>     to process ‘coauthor’ lines after the committer line.  Unlike
>     the ‘author’ line, these would not have a date attached.

I'd suggest just using multiple "author" lines for this, for two
reasons:

- Some tools might already handle this in a sensible way without
  breaking.  For instance, git show and git log seem to do the right
  thing already.

- It seems odd to have one author listed as "author" and others as
  "coauthor".

Also, I don't see any reason not to have the date attached to each
author; it can contain the same date, or under some circumstances it
might make sense for it to contain a different date.  And that way,
tools designed to parse "author" will not need to allow for the lack of
a date.

Multiple "committer" fields seems like an equally reasonable thing to
add support for at the same time, by the way.

>  2. Teach ‘git fsck’ (and hence index-pack, etc) to warn about them but
>     not error out.

git fsck seems to work just fine with multiple author fields in a
commit.

git fast-import needs fixing, though; it currently crashes if given
multiple author fields.

>  3. Add a configuration variable to allow git to produce
>     multiple-author commits.  Such commits would make the repository
>     unusable by versions of git without (1) and (2), so probably nobody
>     would want to enable this for a while.

Agreed; the usual backward-compatibility delay.

> Sounds doable but a lot of trouble.  Maybe Nicolas Pitre or Shawn Pearce
> could say more if you want to pursue this.
> 
> Alternatively, maybe format-patch, fast-import/fast-export, and am
> should cheat by processing Co-authored-by lines at the top of the final
> paragraph of the commit message themselves.

Even with Git's current support for Signed-off-by, it still makes a
point of generally not parsing the commit message in any way.  That
seems like a feature worth preserving.

> BTW, thanks for all your work on git.  Your bug reports are a lot of
> fun to read.

Thanks!  Always nice to hear. :)

> What do you think?

I have this on my long-term TODO list to implement at some point, when I
scrounge up enough round tuits. :)

- Josh Triplett



--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to