quilt-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Quilt-dev] Annotate any version of a file


From: Andreas Gruenbacher
Subject: Re: [Quilt-dev] Annotate any version of a file
Date: Sun, 11 Sep 2005 04:21:34 +0200
User-agent: KMail/1.7.1

On Saturday 10 September 2005 22:41, Jean Delvare wrote:
> Hi all,
>
> I might need to be able to annotate any version of a file, rather than
> its current state, in a near future. So I started hacking the quilt
> annotate command. Now I have working code, so I thought I'd just post it
> here for review and comments. In particular, I would like to know if
> there is a general interest in having this feature added to quilt.
>
> Concretely, I have been adding a -p option to annotate, and when used,
> the annotation loop stops at this patch rather than going on up to the
> top patch. My tests are successful, and I've extended the test suite to
> test this option.

The annotate help text failed to mention that only applied patches will show 
(which I first thought was kind of obvious). So the same effect could also be 
achieved by popping to the right patch. It may still be useful to add the -p 
option, in particular because a patch later on the stack might remove text 
(e.g., move it around), and the information which patches modified that text 
is not contained in the final annotation.

> You'll see a comment about next_patch needing to be computed again -
> that's the point that raised my earlier questions about variables and
> pipes. If anyone can find a more elegant implementation, please speak
> up.

I see now what you were struggling with. In this case I would probably have 
moved the "| @PATCH@ $template" inside the loop, or switched to a tempfile 
for the entire patch. What do you think of the attached version instead 
though? It's almost the same but cleaner.

> Two more notes:
>
> 1* "quilt annotate -p $(quilt top) file" is the same as "quilt annotate
> file", so both commands should always behave the same.

Yes.

> 2* I replaced a call to print_series() by a call to applied_patches() in
                                            ^ cat_series you mean.
> the process (in the case -p isn't used) as it seemed more optimal to me
> that way. If I'm wrong, just let me know. If I'm not, then this change
> can go in even if this patch doesn't.

That's an improvement, yes.

Cheers,
Andreas.

Attachment: annotate.diff
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]