[darcs-devel] adding feature: patch origins

Ganesh Sittampalam ganesh at earth.li
Tue Feb 12 08:15:04 UTC 2013


Hi,

On 11/02/2013 08:59, Stefan Wehr wrote:

> The idea for this feature comes from the daily work in our company
> with darcs. It's often beneficial to see the "history" of a
> repository. With history I mean information about additions and
> removals of patches. For every such edit operation, I would like to be
> able to see who added or removed certain patches and when did the
> change occur.

There's a checklist of things to think about when adding new features at
http://darcs.net/Development/NewFeature that would probably be worth
thinking through.

Generally, I think it's important that darcs supports metadata that
tracks this kind of information; but I worry a little that the specific
feature proposed is a bit ad-hoc. In particular I wonder how we could
ever extend it to support things like obliterate if the information is
directly associated with specific patches.

> I don't think that the terminology "origin" is correct. For me,
> information about the origin of a patch is exactly what darcs already
> provides: who recorded the patch and when was it done. It's more about
> maintainership: who applied a patch and when was it done. Btw, git
> makes exactly the same distinction: the former information is called
> Author and AuthorDate, the latter Commit and CommitDate in git. For
> darcs, I would suggest the terminology Maintainer and MaintainerDate
> instead.
> 
> Note that history information is *not* a property of a certain patch
> but of a repository.

In darcs itself we track this kind of information using our patch
tracker, and it's certainly sub-optimal; storing it in a repository
would be a definite step forward.

One thought is that it's a bit at odds with the distributed nature of
darcs to store this information only in a specific repository; I wonder
if it's actually the state of a repository per se that's important here,
but rather the state of one particular branch. For example the official
version of a piece of software or the official state of the development
branch or whatever.

Another way of looking at what's needed might be to think of it as a
record of the decisions that go into the make-up of that branch, rather
than specifically into a particular repository that happens to be being
used as the central place to get that branch right now.

How much of what you want could be achieved with tags and post hooks? I
suspect it's not a complete solution but it would be good to identify
the gaps/deficiencies in alternate models that can piggy-back on the
existing world.

In particular, on each darcs command, have a post-hook that tags the
repository. This would implicitly record the user and the date/time, and
the diff to the previous tag would provide information about what had
changed.

One obvious downside is that the tags would be quite intrusive, and
another is that the tag info wouldn't be visible in a nice form with
'darcs changes'. They'd also make obliterate hard as you'd have to
obliterate the relevant tags too.

I think these issues could possibly be addressed by storing the tags off
to one side instead of in the actual repository, but the details would
need thinking through.

Cheers,

Ganesh


More information about the darcs-devel mailing list