[darcs-users] darcs annotate format obscures the code

Ivan Stankovic pokemon at fly.srk.fer.hr
Sun Mar 20 22:59:57 UTC 2005


On Sun, Mar 20, 2005 at 03:34:53PM -0500, Michael Conrad wrote:
> On Sunday, March 20, 2005 9:44 AM, Ivan Stankovic wrote:
> 
> > On Sun, Mar 20, 2005 at 01:58:50PM +0000, Ralph Corderoy wrote:
> > > Hi Jamie,
> > > > I'd rather see the numbers in the output of darcs changes. That way I
> > > > can run annotate in one window and changes in another. Modification of
> > > > the repo shouldn't be a problem because a) presumably this is usually
> > > > being done in a private copy
> > >
> > > Usually isn't good enough to avoid misleading output to the user.
> > >
> > > > and b) any new patches will just get higher numbers.
> > >
> > > I don't think that's true.  They're date ordered and the date is when
> > > the patch was recording, not when it was added to this repo, so
> > > introducing a patch written six months ago will bump lots of numbers on
> > > by one.
> >
> > So how about adding a patch attribute like 'date of addition to the
> > repository'? This attrubute would differ from record-date only if the
> > user pulled the patch from another repository. With this in place, you
> > could make 'darcs changes' and 'darcs annotate' build a sorted list of
> > patches and number each patch accordingly.
> <snip>
> > Personally, I'd love to be able to refer to a patch by a simple number
> > instead of a regexp.
> 
> So, I'm getting this feeling like nobody ever read my post in
> mid-february... the lack of replies had me wondering that already ;-)  I was
> just going to write it up myself sometime, but I'm still short on free time.
> For anyone who would like to read it:
> http://www.abridgegame.org/pipermail/darcs-users/2005-February/005455.html

Quoting from the above message:

<start>
194 apply "Full patch name as seen in inventory"
195 apply "Patch Blah...."
196 apply "Patch Bleh...."
TAG: "1.0.6"
1 apply "Patch Foo....."  // caused by pull, record, or apply
2 apply "Patch Bar....."
3 remove "Patch Bar...."  // caused by rollback, unpull, or unrecord
4 apply "Patch Bar....with new hash"
5 amend-record "Patch Bar....with new hash" // caused by amend-record
...
<end>

This sounds really nice, in that you log every repo-changing action to a file
so you would be even able to use patch numbers as full patch identifiers. 
There are several issues though:

a) what would darcs do if, using the above example, I say 
   'darcs diff -u --patch-number 3'? Would I get the inverse of "Patch Bar..."
   or something else? Similar question for "patch number 5". 
   IMHO, it's confusing to have numbers refering to different things; as you 
   can see, I already began calling these numbers "patch numbers" :)

b) why are the numbers tag-based? I'd find it more natural if they didn't.
   Also, when I say e.g. "Stable-0.1.2" does it mean "tag Stable-0.1.2" or
   "the patch number 2 after the Stable-0.1 tag"? By not using tag-based
   numbers we could avoid this and the problem of unpulling a tag (which
   you wrote about in your mail).

Also, I think it would be wise to put patch hashes in the file as well, could
be used to differentiate between patches with identical names.`

> Basically, I think we CAN get a version number for each revision, and rather
> easily, too.  It would be the perfect thing to display on an annotation.

Absolutely.

> A person could then cross-reference the version number using "darcs query
> version <x>", or we could even write them in the 'changes' output for grep
> to find.

I think there's no need for a new command, just modifying 'changes' to
display patch numbers would be good enoguh. What do others think?

-- 
Ivan Stankovic, pokemon at fly.srk.fer.hr




More information about the darcs-users mailing list