GNU bug report logs - #8159
file-name-sans-version fails for some git files

Previous Next

Package: emacs;

Reported by: Reuben Thomas <rrt <at> sc3d.org>

Date: Wed, 2 Mar 2011 22:32:02 UTC

Severity: normal

Done: Chong Yidong <cyd <at> stupidchicken.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 8159 in the body.
You can then email your comments to 8159 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#8159; Package emacs. (Wed, 02 Mar 2011 22:32:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Reuben Thomas <rrt <at> sc3d.org>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 02 Mar 2011 22:32:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Reuben Thomas <rrt <at> sc3d.org>
To: bug-emacs <bug-emacs <at> gnu.org>
Subject: file-name-sans-version fails for some git files
Date: Wed, 2 Mar 2011 22:31:12 +0000
filenames like foo.js.~HEAD~1~ aren't handled properly because of the
internal tilde.

This is easily fixable by adding tilde to the character class matched
against (in emacs-23 it's in the source of file-name-sans-version; in
the trunk it's in the more accessible file-name-version-regexp).

It seems to me that git is commonly-enough used that this is probably
worth fixing in the source rather than leaving to users who notice the
problem (especially in emacs-23, where it means redefining
file-name-sans-version).

-- 
http://rrt.sc3d.org




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#8159; Package emacs. (Thu, 03 Mar 2011 04:01:02 GMT) Full text and rfc822 format available.

Message #8 received at 8159 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Reuben Thomas <rrt <at> sc3d.org>
Cc: 8159 <at> debbugs.gnu.org
Subject: Re: bug#8159: file-name-sans-version fails for some git files
Date: Thu, 03 Mar 2011 05:58:06 +0200
> Date: Wed, 2 Mar 2011 22:31:12 +0000
> From: Reuben Thomas <rrt <at> sc3d.org>
> Cc: 
> 
> filenames like foo.js.~HEAD~1~ aren't handled properly because of the
> internal tilde.

What would be the "proper" handling of such a file name?  What is the
"version" here?

> This is easily fixable by adding tilde to the character class matched
> against (in emacs-23 it's in the source of file-name-sans-version; in
> the trunk it's in the more accessible file-name-version-regexp).
> 
> It seems to me that git is commonly-enough used that this is probably
> worth fixing in the source rather than leaving to users who notice the
> problem (especially in emacs-23, where it means redefining
> file-name-sans-version).

file-name-sans-versions is used by Emacs to produce backup file
names.  The file name you mention is not in the format of backup file
names that Emacs uses.  Extending file-name-sans-versions in the way
you suggest is not enough; we need also extend the format of backup
file names to support this.  Otherwise, removing the "version", then
adding another one will not produce a file name in this format.




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#8159; Package emacs. (Thu, 03 Mar 2011 12:04:01 GMT) Full text and rfc822 format available.

Message #11 received at 8159 <at> debbugs.gnu.org (full text, mbox):

From: Reuben Thomas <rrt <at> sc3d.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 8159 <at> debbugs.gnu.org
Subject: Re: bug#8159: file-name-sans-version fails for some git files
Date: Thu, 3 Mar 2011 12:02:53 +0000
On 3 March 2011 03:58, Eli Zaretskii <eliz <at> gnu.org> wrote:
>> Date: Wed, 2 Mar 2011 22:31:12 +0000
>> From: Reuben Thomas <rrt <at> sc3d.org>
>> Cc:
>>
>> filenames like foo.js.~HEAD~1~ aren't handled properly because of the
>> internal tilde.
>
> What would be the "proper" handling of such a file name?  What is the
> "version" here?

The version is HEAD~1, so the only difference from supported version
formats is the internal tilde.

I can't see (yet) how this doesn't work with backup file names. In
particular, it can't be mistaken for a numbered backup file, since it
doesn't end `.~%d~'; on the other hand, both the simple backup suffix
~ and numeric backups suffix `.~%d~' are still correctly stripped by
my modified file-name-sans-versions.

-- 
http://rrt.sc3d.org




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#8159; Package emacs. (Thu, 03 Mar 2011 13:37:01 GMT) Full text and rfc822 format available.

Message #14 received at 8159 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Reuben Thomas <rrt <at> sc3d.org>
Cc: 8159 <at> debbugs.gnu.org
Subject: Re: bug#8159: file-name-sans-version fails for some git files
Date: Thu, 03 Mar 2011 08:36:35 -0500
> Date: Thu, 3 Mar 2011 12:02:53 +0000
> From: Reuben Thomas <rrt <at> sc3d.org>
> Cc: 8159 <at> debbugs.gnu.org
> 
> On 3 March 2011 03:58, Eli Zaretskii <eliz <at> gnu.org> wrote:
> >> Date: Wed, 2 Mar 2011 22:31:12 +0000
> >> From: Reuben Thomas <rrt <at> sc3d.org>
> >> Cc:
> >>
> >> filenames like foo.js.~HEAD~1~ aren't handled properly because of the
> >> internal tilde.
> >
> > What would be the "proper" handling of such a file name?  What is the
> > "version" here?
> 
> The version is HEAD~1, so the only difference from supported version
> formats is the internal tilde.

If you don't want the version to be "~1~", then I guess this is okay.
It wasn't clear from your original message that you don't consider
this form a numbered backup file.

> I can't see (yet) how this doesn't work with backup file names. In
> particular, it can't be mistaken for a numbered backup file, since it
> doesn't end `.~%d~'; on the other hand, both the simple backup suffix
> ~ and numeric backups suffix `.~%d~' are still correctly stripped by
> my modified file-name-sans-versions.

If you are okay with having foo.js~ as a simple backup file name of
foo.js.~HEAD~1~ and foo.js.~3~ as its numbered backup, then I see no
issues here.  I just wonder if that would surprise git users (I don't
use it too much, so I don't know).




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#8159; Package emacs. (Thu, 03 Mar 2011 13:40:03 GMT) Full text and rfc822 format available.

Message #17 received at 8159 <at> debbugs.gnu.org (full text, mbox):

From: Reuben Thomas <rrt <at> sc3d.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 8159 <at> debbugs.gnu.org
Subject: Re: bug#8159: file-name-sans-version fails for some git files
Date: Thu, 3 Mar 2011 13:39:32 +0000
On 3 March 2011 13:36, Eli Zaretskii <eliz <at> gnu.org> wrote:
>
> If you are okay with having foo.js~ as a simple backup file name of
> foo.js.~HEAD~1~ and foo.js.~3~ as its numbered backup, then I see no
> issues here.  I just wonder if that would surprise git users (I don't
> use it too much, so I don't know).

Why would you have a backup of such a file? It's a file visited with
vc-revision-other-window, which is by default read-only.

The question arises equally for other VC systems, it's just that not
all of them allow version numbers that contain tildes.

-- 
http://rrt.sc3d.org




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#8159; Package emacs. (Thu, 03 Mar 2011 13:58:02 GMT) Full text and rfc822 format available.

Message #20 received at 8159 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Reuben Thomas <rrt <at> sc3d.org>
Cc: 8159 <at> debbugs.gnu.org
Subject: Re: bug#8159: file-name-sans-version fails for some git files
Date: Thu, 03 Mar 2011 08:57:25 -0500
> Date: Thu, 3 Mar 2011 13:39:32 +0000
> From: Reuben Thomas <rrt <at> sc3d.org>
> Cc: 8159 <at> debbugs.gnu.org
> 
> On 3 March 2011 13:36, Eli Zaretskii <eliz <at> gnu.org> wrote:
> >
> > If you are okay with having foo.js~ as a simple backup file name of
> > foo.js.~HEAD~1~ and foo.js.~3~ as its numbered backup, then I see no
> > issues here.  I just wonder if that would surprise git users (I don't
> > use it too much, so I don't know).
> 
> Why would you have a backup of such a file?

Because vc-make-backup-files is set non-nil?

> It's a file visited with
> vc-revision-other-window, which is by default read-only.

Is that the only way to visit files with such names?

Anyway, your change is not limited to this particular situation, it is
more general.  It will affect any file of that form, anywhere.




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#8159; Package emacs. (Thu, 03 Mar 2011 14:01:02 GMT) Full text and rfc822 format available.

Message #23 received at 8159 <at> debbugs.gnu.org (full text, mbox):

From: Reuben Thomas <rrt <at> sc3d.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 8159 <at> debbugs.gnu.org
Subject: Re: bug#8159: file-name-sans-version fails for some git files
Date: Thu, 3 Mar 2011 14:00:47 +0000
On 3 March 2011 13:57, Eli Zaretskii <eliz <at> gnu.org> wrote:
> Anyway, your change is not limited to this particular situation, it is
> more general.  It will affect any file of that form, anywhere.

Sure. What I am trying to understand is why this change should be any
more of a problem than the currently-accepted suffixes for VC systems.
You said earlier:

> If you are okay with having foo.js~ as a simple backup file name of
> foo.js.~HEAD~1~ and foo.js.~3~ as its numbered backup,
> then I see no issues here

Indeed, I don't have a problem with this; I was just trying to point
out that because of the way these suffixes normally arise, they rarely
have backups.

-- 
http://rrt.sc3d.org




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#8159; Package emacs. (Thu, 03 Mar 2011 14:34:01 GMT) Full text and rfc822 format available.

Message #26 received at 8159 <at> debbugs.gnu.org (full text, mbox):

From: Andreas Schwab <schwab <at> linux-m68k.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 8159 <at> debbugs.gnu.org, Reuben Thomas <rrt <at> sc3d.org>
Subject: Re: bug#8159: file-name-sans-version fails for some git files
Date: Thu, 03 Mar 2011 15:33:30 +0100
Eli Zaretskii <eliz <at> gnu.org> writes:

>> Date: Thu, 3 Mar 2011 12:02:53 +0000
>> From: Reuben Thomas <rrt <at> sc3d.org>
>> Cc: 8159 <at> debbugs.gnu.org
>> 
>> On 3 March 2011 03:58, Eli Zaretskii <eliz <at> gnu.org> wrote:
>> >> Date: Wed, 2 Mar 2011 22:31:12 +0000
>> >> From: Reuben Thomas <rrt <at> sc3d.org>
>> >> Cc:
>> >>
>> >> filenames like foo.js.~HEAD~1~ aren't handled properly because of the
>> >> internal tilde.
>> >
>> > What would be the "proper" handling of such a file name?  What is the
>> > "version" here?
>> 
>> The version is HEAD~1, so the only difference from supported version
>> formats is the internal tilde.
>
> If you don't want the version to be "~1~", then I guess this is okay.

It cannot be the version because it lacks the period.

Andreas.

-- 
Andreas Schwab, schwab <at> linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#8159; Package emacs. (Thu, 03 Mar 2011 14:36:01 GMT) Full text and rfc822 format available.

Message #29 received at 8159 <at> debbugs.gnu.org (full text, mbox):

From: Reuben Thomas <rrt <at> sc3d.org>
To: Andreas Schwab <schwab <at> linux-m68k.org>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 8159 <at> debbugs.gnu.org
Subject: Re: bug#8159: file-name-sans-version fails for some git files
Date: Thu, 3 Mar 2011 14:35:05 +0000
On 3 March 2011 14:33, Andreas Schwab <schwab <at> linux-m68k.org> wrote:
>
> It cannot be the version because it lacks the period.

I think you're confusing two things: the VC version and the backup
version. Eli was talking (if I understood correctly) about the VC
version (which could be ~1~, e.g. in Subversion).

-- 
http://rrt.sc3d.org




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#8159; Package emacs. (Thu, 03 Mar 2011 14:46:01 GMT) Full text and rfc822 format available.

Message #32 received at 8159 <at> debbugs.gnu.org (full text, mbox):

From: Andreas Schwab <schwab <at> linux-m68k.org>
To: Reuben Thomas <rrt <at> sc3d.org>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 8159 <at> debbugs.gnu.org
Subject: Re: bug#8159: file-name-sans-version fails for some git files
Date: Thu, 03 Mar 2011 15:45:01 +0100
Reuben Thomas <rrt <at> sc3d.org> writes:

> On 3 March 2011 14:33, Andreas Schwab <schwab <at> linux-m68k.org> wrote:
>>
>> It cannot be the version because it lacks the period.
>
> I think you're confusing two things: the VC version and the backup
> version. Eli was talking (if I understood correctly) about the VC
> version (which could be ~1~, e.g. in Subversion).

No, it would be ".~1~".  A version suffix will always start with a
period.

Andreas.

-- 
Andreas Schwab, schwab <at> linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#8159; Package emacs. (Thu, 03 Mar 2011 14:57:01 GMT) Full text and rfc822 format available.

Message #35 received at 8159 <at> debbugs.gnu.org (full text, mbox):

From: Reuben Thomas <rrt <at> sc3d.org>
To: Andreas Schwab <schwab <at> linux-m68k.org>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 8159 <at> debbugs.gnu.org
Subject: Re: bug#8159: file-name-sans-version fails for some git files
Date: Thu, 3 Mar 2011 14:53:34 +0000
On 3 March 2011 14:45, Andreas Schwab <schwab <at> linux-m68k.org> wrote:
> Reuben Thomas <rrt <at> sc3d.org> writes:
>
>> On 3 March 2011 14:33, Andreas Schwab <schwab <at> linux-m68k.org> wrote:
>>>
>>> It cannot be the version because it lacks the period.
>>
>> I think you're confusing two things: the VC version and the backup
>> version. Eli was talking (if I understood correctly) about the VC
>> version (which could be ~1~, e.g. in Subversion).
>
> No, it would be ".~1~".  A version suffix will always start with a
> period.

Sorry, I see what you mean, and that's why it's not ambiguous.

-- 
http://rrt.sc3d.org




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#8159; Package emacs. (Thu, 03 Mar 2011 15:10:03 GMT) Full text and rfc822 format available.

Message #38 received at 8159 <at> debbugs.gnu.org (full text, mbox):

From: Andreas Schwab <schwab <at> linux-m68k.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 8159 <at> debbugs.gnu.org, Reuben Thomas <rrt <at> sc3d.org>
Subject: Re: bug#8159: file-name-sans-version fails for some git files
Date: Thu, 03 Mar 2011 16:09:37 +0100
Eli Zaretskii <eliz <at> gnu.org> writes:

> Anyway, your change is not limited to this particular situation, it is
> more general.  It will affect any file of that form, anywhere.

file-name-version-regexp is already very general.  But one problem is
that by adding ~ it would match backups of backups.

Andreas.

-- 
Andreas Schwab, schwab <at> linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#8159; Package emacs. (Thu, 03 Mar 2011 15:27:01 GMT) Full text and rfc822 format available.

Message #41 received at 8159 <at> debbugs.gnu.org (full text, mbox):

From: Reuben Thomas <rrt <at> sc3d.org>
To: Andreas Schwab <schwab <at> linux-m68k.org>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 8159 <at> debbugs.gnu.org
Subject: Re: bug#8159: file-name-sans-version fails for some git files
Date: Thu, 3 Mar 2011 15:26:05 +0000
On 3 March 2011 15:09, Andreas Schwab <schwab <at> linux-m68k.org> wrote:
> Eli Zaretskii <eliz <at> gnu.org> writes:
>
>> Anyway, your change is not limited to this particular situation, it is
>> more general.  It will affect any file of that form, anywhere.
>
> file-name-version-regexp is already very general.  But one problem is
> that by adding ~ it would match backups of backups.

To be precise, it would match non-numbered backups of non-numbered
backups of non-numbered backups, and non-numbered backups of numbered
backups: the current pattern requires either a single ~, or two tildes
with at least one other character between them.

To fix this would require specifying that an internal tilde is
preceded and followed by at least one character from the rest of the
character class [-[:alnum:]:#@^._] (or, if you just want to cope with
git notation, then preceded by one such character, and followed by a
digit), i.e. something like

\\(?:~\\|\\.~[-[:alnum:]:#@^._]+\\([-[:alnum:]:#@^._~]*[-[:alnum:]:#@^._]+\\)?~\\)

-- 
http://rrt.sc3d.org




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#8159; Package emacs. (Thu, 03 Mar 2011 16:24:01 GMT) Full text and rfc822 format available.

Message #44 received at 8159 <at> debbugs.gnu.org (full text, mbox):

From: Andreas Schwab <schwab <at> linux-m68k.org>
To: Reuben Thomas <rrt <at> sc3d.org>
Cc: 8159 <at> debbugs.gnu.org
Subject: Re: bug#8159: file-name-sans-version fails for some git files
Date: Thu, 03 Mar 2011 17:23:45 +0100
Reuben Thomas <rrt <at> sc3d.org> writes:

> \\(?:~\\|\\.~[-[:alnum:]:#@^._]+\\([-[:alnum:]:#@^._~]*[-[:alnum:]:#@^._]+\\)?~\\)

That still matches ".~1~.~2~".

Andreas.

-- 
Andreas Schwab, schwab <at> linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#8159; Package emacs. (Thu, 03 Mar 2011 22:59:01 GMT) Full text and rfc822 format available.

Message #47 received at 8159 <at> debbugs.gnu.org (full text, mbox):

From: Reuben Thomas <rrt <at> sc3d.org>
To: Andreas Schwab <schwab <at> linux-m68k.org>
Cc: 8159 <at> debbugs.gnu.org
Subject: Re: bug#8159: file-name-sans-version fails for some git files
Date: Thu, 3 Mar 2011 22:58:14 +0000
On 3 March 2011 16:23, Andreas Schwab <schwab <at> linux-m68k.org> wrote:
> Reuben Thomas <rrt <at> sc3d.org> writes:
>
>> \\(?:~\\|\\.~[-[:alnum:]:#@^._]+\\([-[:alnum:]:#@^._~]*[-[:alnum:]:#@^._]+\\)?~\\)
>
> That still matches ".~1~.~2~".

\\(?:~\\|\\.~[-[:alnum:]:#@^._]+\\(~[[:digit:]]+\\)?~\\)

would cope with just the git version scheme, while not swallowing
multiple backup suffixes.

-- 
http://rrt.sc3d.org




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#8159; Package emacs. (Fri, 04 Mar 2011 07:59:02 GMT) Full text and rfc822 format available.

Message #50 received at 8159 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Reuben Thomas <rrt <at> sc3d.org>
Cc: schwab <at> linux-m68k.org, 8159 <at> debbugs.gnu.org
Subject: Re: bug#8159: file-name-sans-version fails for some git files
Date: Fri, 04 Mar 2011 09:55:51 +0200
> Date: Thu, 3 Mar 2011 22:58:14 +0000
> From: Reuben Thomas <rrt <at> sc3d.org>
> Cc: 8159 <at> debbugs.gnu.org
> 
> \\(?:~\\|\\.~[-[:alnum:]:#@^._]+\\(~[[:digit:]]+\\)?~\\)
> 
> would cope with just the git version scheme, while not swallowing
> multiple backup suffixes.

I would suggest a comment mentioning the git case with an example.




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#8159; Package emacs. (Sat, 05 Mar 2011 16:43:02 GMT) Full text and rfc822 format available.

Message #53 received at 8159 <at> debbugs.gnu.org (full text, mbox):

From: Reuben Thomas <rrt <at> sc3d.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: schwab <at> linux-m68k.org, 8159 <at> debbugs.gnu.org
Subject: Re: bug#8159: file-name-sans-version fails for some git files
Date: Sat, 5 Mar 2011 16:42:40 +0000
On 4 March 2011 07:55, Eli Zaretskii <eliz <at> gnu.org> wrote:
>> Date: Thu, 3 Mar 2011 22:58:14 +0000
>> From: Reuben Thomas <rrt <at> sc3d.org>
>> Cc: 8159 <at> debbugs.gnu.org
>>
>> \\(?:~\\|\\.~[-[:alnum:]:#@^._]+\\(~[[:digit:]]+\\)?~\\)
>>
>> would cope with just the git version scheme, while not swallowing
>> multiple backup suffixes.
>
> I would suggest a comment mentioning the git case with an example.

So, something like:

(defvar file-name-version-regexp
  "\\(?:~\\|\\.~[-[:alnum:]:#@^._]+\\(~[[:digit:]]+\\)?~\\)"
  ;; The optional ~[[:digit]]+ matches relative versions in git like `HEAD~2'
  "Regular expression matching the backup/version part of a file name.
Used by `file-name-sans-versions'.")

?

-- 
http://rrt.sc3d.org




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#8159; Package emacs. (Sat, 05 Mar 2011 17:03:01 GMT) Full text and rfc822 format available.

Message #56 received at 8159 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Reuben Thomas <rrt <at> sc3d.org>
Cc: schwab <at> linux-m68k.org, 8159 <at> debbugs.gnu.org
Subject: Re: bug#8159: file-name-sans-version fails for some git files
Date: Sat, 05 Mar 2011 19:00:01 +0200
> Date: Sat, 5 Mar 2011 16:42:40 +0000
> From: Reuben Thomas <rrt <at> sc3d.org>
> Cc: schwab <at> linux-m68k.org, 8159 <at> debbugs.gnu.org
> 
> >> \\(?:~\\|\\.~[-[:alnum:]:#@^._]+\\(~[[:digit:]]+\\)?~\\)
> >>
> >> would cope with just the git version scheme, while not swallowing
> >> multiple backup suffixes.
> >
> > I would suggest a comment mentioning the git case with an example.
> 
> So, something like:
> 
> (defvar file-name-version-regexp
>   "\\(?:~\\|\\.~[-[:alnum:]:#@^._]+\\(~[[:digit:]]+\\)?~\\)"
>   ;; The optional ~[[:digit]]+ matches relative versions in git like `HEAD~2'
>   "Regular expression matching the backup/version part of a file name.
> Used by `file-name-sans-versions'.")
> 
> ?

Yes, that's fine.  Thanks.




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#8159; Package emacs. (Sat, 05 Mar 2011 22:03:03 GMT) Full text and rfc822 format available.

Message #59 received at 8159 <at> debbugs.gnu.org (full text, mbox):

From: Chong Yidong <cyd <at> stupidchicken.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: schwab <at> linux-m68k.org, 8159 <at> debbugs.gnu.org, Reuben Thomas <rrt <at> sc3d.org>
Subject: Re: bug#8159: file-name-sans-version fails for some git files
Date: Sat, 05 Mar 2011 15:36:07 -0500
Eli Zaretskii <eliz <at> gnu.org> writes:

>> So, something like:
>>
>> (defvar file-name-version-regexp
>>   "\\(?:~\\|\\.~[-[:alnum:]:#@^._]+\\(~[[:digit:]]+\\)?~\\)"
>>   ;; The optional ~[[:digit]]+ matches relative versions in git like `HEAD~2'
>>   "Regular expression matching the backup/version part of a file name.
>> Used by `file-name-sans-versions'.")
>
> Yes, that's fine.  Thanks.

Committed to trunk.




bug closed, send any further explanations to 8159 <at> debbugs.gnu.org and Reuben Thomas <rrt <at> sc3d.org> Request was from Chong Yidong <cyd <at> stupidchicken.com> to control <at> debbugs.gnu.org. (Sat, 05 Mar 2011 22:03:06 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 03 Apr 2011 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 14 years and 84 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.