Ticket #2889 (new defect)

Opened 1 year ago

Last modified 2 months ago

version date is incorrect when ChangeLog is not up-to-date

Reported by: vinc17 Assigned to: mutt-dev
Priority: minor Milestone:
Component: build Version:
Keywords: Cc:

Description

When the changelog file is not up-to-date, the version date (as output by "mutt -v") is incorrect. In practice, this is the case when one has a Mercurial working copy. So, a solution is to try "hg tip --template '{date|shortdate}'".

Attachments

patch-1.5.15hg.vl.reldate.1 (0.7 kB) - added by vinc17 on 2007-05-16 04:56:53.
patch to use hg tip…

Change History

2007-05-16 04:56:53 changed by vinc17

  • attachment patch-1.5.15hg.vl.reldate.1 added.

patch to use hg tip...

2007-05-16 04:59:43 changed by vinc17

  • component changed from mutt to build.

Note about the patch: I've set the dependencies so that the reldate code is run everytime when typing "make" to make sure reldate.h is up-to-date.

2008-05-29 04:01:12 changed by pdmef

In general I think this is right. However, this breaks if you're not compiling tip (e.g. checked out some tag or specific revision, or in the middle of bisect). OTOH it's kind of an edge case and the question is whether people actually do install that version...

2008-05-30 04:38:29 changed by Vincent Lefevre

On 2008-05-29 11:01:15 -0000, Mutt wrote:
>  In general I think this is right. However, this breaks if you're
>  not compiling tip (e.g. checked out some tag or specific revision,
>  or in the middle of bisect). OTOH it's kind of an edge case and the
>  question is whether people actually do install that version...

I suppose that the hg command could be improved. But I don't know
much about Mercurial...

2008-05-30 05:18:06 changed by Rocco Rutte

Hi,

* Vincent Lefevre wrote:
>On 2008-05-29 11:01:15 -0000, Mutt wrote:

>>  In general I think this is right. However, this breaks if you're
>>  not compiling tip (e.g. checked out some tag or specific revision,
>>  or in the middle of bisect). OTOH it's kind of an edge case and the
>>  question is whether people actually do install that version...

>I suppose that the hg command could be improved. But I don't know
>much about Mercurial...

Well, the best thing I can come up with so far is:

   hg log -r `hg id | cut -d' ' -f1` --template '{date|shortdate}'

though I wonder what implications this has when building from tarballs 
(e.g. you unpack the tarball in some dir whose parent is a hg repo: you 
get the parent dir's tip, not mutt's).

I think the much cleaner solution would be to use a commit wrapper 
script where you enter your change message. This would generate the 
proper ChangeLog line before committing so we could keep using ChangeLog 
since it'd be always up-to-date. But I don't know how well that would 
work with merging...

Rocco

2008-05-30 06:59:18 changed by Vincent Lefevre

On 2008-05-30 14:17:31 +0200, Rocco Rutte wrote:
> Well, the best thing I can come up with so far is:
>
>   hg log -r `hg id | cut -d' ' -f1` --template '{date|shortdate}'
>
> though I wonder what implications this has when building from tarballs  
> (e.g. you unpack the tarball in some dir whose parent is a hg repo: you  
> get the parent dir's tip, not mutt's).

One could add something like "test -d .hg", or would there be another
problem with that (e.g. users for which Mutt is a subdirectory in
their own Mercurial repository, if possible)?

Can't hg restrict logs to the current directory instead of looking
at the parent too? (So, if the current directory comes from a tarball,
there should be no logs and this could be detected.)

> I think the much cleaner solution would be to use a commit wrapper  
> script where you enter your change message. This would generate the  
> proper ChangeLog line before committing so we could keep using ChangeLog  
> since it'd be always up-to-date. But I don't know how well that would  
> work with merging...

Maybe. FYI, in coreutils (with git), the ChangeLog is not under
version control, but generated for tarballs[*]. If Mutt goes this
way, the presence of the ChangeLog file could be detected.

[*] http://git.savannah.gnu.org/gitweb/?p=coreutils.git;a=blob;f=HACKING;hb=HEAD