"GOT", but the "O" is a cute, smiling pufferfish. Index | Thread | Search

From:
Stefan Sperling <stsp@stsp.name>
Subject:
Re: draft: keeping authorship of diffs in commits
To:
Omar Polo <op@omarpolo.com>, gameoftrees@openbsd.org
Date:
Mon, 18 Jul 2022 11:52:30 +0200

Download raw body.

Thread
On Sun, Feb 06, 2022 at 02:16:39PM +0100, Stefan Sperling wrote:
> On Sun, Feb 06, 2022 at 11:20:55AM +0100, Omar Polo wrote:
> > There's also another one issue I think: nomenclature.  got(1) mention
> > various time the "commit author", the env variable is called GOT_AUTHOR
> > and the got.conf setting is `author'.  Adding a "-A author" to got ci
> > which does a subtly different thing can easily confuse people.
> 
> Yes, in hindsight this is bad, because it makes it harder to make
> a clear distinction between committer and author. This happened
> because I did not consider this distinction important enough, as
> this is no problem with the way CVS is being used today. However,
> expectations may change with a new repository format that is able
> to store additional meta-data.
> 
> The good news is that we can change anything! At this stage, breaking
> things in incompatible ways is absolutely fine. Anybody who is using
> Got nowadays must be ready to adjust their setup to changes we make
> at any moment. Release numbers start with a zero for a reason and I
> do not expect this to change anytime soon.
> 
> Should we just rename all these things to "committer" or is there
> a better path forward?

Going back to this: I tought about this some more and I don't think
it is a big problem. Usually, the person who creates a new commit
is the author, so the names we have for configuration items are fine.

We can add specific options to override the "author" in commit objects,
and simply document that the default value for this comes from GOT_AUTHOR
or the config file, and document that this default value will always
be used for the "committer" field. This should be clear enough.

Your patch is a good start. It satisfies the use case of patch contributions.
Of course, since this requires action on part of the committer, there will
always be commit objects created from patches which lack attribution of the
author in the commit object's author field, which means this "meta-data" will
not be very reliable. Not much we can do about that.
I don't really like the idea of complicating 'got patch' to the point where
it tries to figure out author information from patch files. We would need to
encourage people to save patches as an mbox file instead of saving only the
body of an email, which is just as unlikely to work as consistently adding
an option like -A to 'got commit' command lines.
But because this would interop with output of git-format-patch, perhaps some
people would use such a feature? If we added this to 'got patch' we should
probably also extend 'got diff' to produce compatible output, at least as
an option?

Additionally, it would be nice if 'got rebase' and 'got histedit' would
preserve the original commit's author field as "author", while the
"committer" field would be reset to the value of GOT_AUTHOR or the
config file. Once we do this, I think the distinction will become more
or less self-evident for people who are familiar with these commands.