All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <junkio@cox.net>
To: Andy Parkins <andyparkins@gmail.com>
Cc: git@vger.kernel.org, Johannes Sixt <J.Sixt@eudaptics.com>
Subject: Re: [PATCH] Use $Id$ as the ident attribute keyword rather than $ident$  to be consistent with other VCSs
Date: Mon, 14 May 2007 19:03:02 -0700	[thread overview]
Message-ID: <7vmz06lu7d.fsf@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: <200705142324.02929.andyparkins@gmail.com> (Andy Parkins's message of "Mon, 14 May 2007 23:24:01 +0100")

Andy Parkins <andyparkins@gmail.com> writes:

> On Monday 2007, May 14, Junio C Hamano wrote:
>
>> Obviously I do not care much about this feature and I have not
>> look at Andy's patch too deeply yet, but in any case I think the
>> inverse conversion needs to be modified to match it, if it
>> hasn't been done so.
>
> I believe I did the inverse conversion as well.

I think this on top of your patch would be the minimum necessary
for v1.5.2.

 Documentation/RelNotes-1.5.2.txt |    2 +-
 Documentation/gitattributes.txt  |    6 +++---
 convert.c                        |   14 +++++++-------
 t/t0021-conversion.sh            |    4 ++--
 4 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/Documentation/RelNotes-1.5.2.txt b/Documentation/RelNotes-1.5.2.txt
index d1c2cac..7dbdb26 100644
--- a/Documentation/RelNotes-1.5.2.txt
+++ b/Documentation/RelNotes-1.5.2.txt
@@ -26,7 +26,7 @@ Updates since v1.5.1
   considered a binary or text (the former would be treated by
   'git diff' not to produce textual output; the latter can go
   through the line endings conversion process in repositories
-  with core.autocrlf set), expand and unexpand '$ident$' keyword
+  with core.autocrlf set), expand and unexpand '$Id$' keyword
   with blob object name, specify a custom 3-way merge driver,
   and specify a custom diff driver.  You can also apply
   arbitrary filter to contents on check-in/check-out codepath
diff --git a/Documentation/gitattributes.txt b/Documentation/gitattributes.txt
index 8772310..d3ac9c7 100644
--- a/Documentation/gitattributes.txt
+++ b/Documentation/gitattributes.txt
@@ -138,11 +138,11 @@ upon checkout.
 ^^^^^^^
 
 When the attribute `ident` is set to a path, git replaces
-`$ident$` in the blob object with `$ident:`, followed by
+`$Id$` in the blob object with `$Id:`, followed by
 40-character hexadecimal blob object name, followed by a dollar
 sign `$` upon checkout.  Any byte sequence that begins with
-`$ident:` and ends with `$` in the worktree file is replaced
-with `$ident$` upon check-in.
+`$Id:` and ends with `$` in the worktree file is replaced
+with `$Id$` upon check-in.
 
 
 Interaction between checkin/checkout attributes
diff --git a/convert.c b/convert.c
index c46ab1b..12abdaf 100644
--- a/convert.c
+++ b/convert.c
@@ -422,20 +422,20 @@ static int count_ident(const char *cp, unsigned long size)
 		size--;
 		if (ch != '$')
 			continue;
-		if (size < 6)
+		if (size < 3)
 			break;
-		if (memcmp("ident", cp, 5))
+		if (memcmp("Id", cp, 2))
 			continue;
-		ch = cp[5];
-		cp += 6;
-		size -= 6;
+		ch = cp[2];
+		cp += 3;
+		size -= 3;
 		if (ch == '$')
-			cnt++; /* $ident$ */
+			cnt++; /* $Id$ */
 		if (ch != ':')
 			continue;
 
 		/*
-		 * "$ident: ... "; scan up to the closing dollar sign and discard.
+		 * "$Id: ... "; scan up to the closing dollar sign and discard.
 		 */
 		while (size) {
 			ch = *cp++;
diff --git a/t/t0021-conversion.sh b/t/t0021-conversion.sh
index bab9ecc..6c26fd8 100755
--- a/t/t0021-conversion.sh
+++ b/t/t0021-conversion.sh
@@ -21,7 +21,7 @@ test_expect_success setup '
 	{
 	    echo a b c d e f g h i j k l m
 	    echo n o p q r s t u v w x y z
-	    echo '\''$ident$'\''
+	    echo '\''$Id$'\''
 	} >test &&
 	cat test >test.t &&
 	cat test >test.o &&
@@ -31,7 +31,7 @@ test_expect_success setup '
 	git checkout -- test test.t test.i
 '
 
-script='s/^\$ident: \([0-9a-f]*\) \$/\1/p'
+script='s/^\$Id: \([0-9a-f]*\) \$/\1/p'
 
 test_expect_success check '
 

  parent reply	other threads:[~2007-05-15  2:03 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-14 13:05 [PATCH] Allow the ident attribute to include a length specifier Andy Parkins
2007-05-14 13:29 ` Andy Parkins
2007-05-14 13:37   ` [PATCH] Use $Id$ as the ident attribute keyword rather than $ident$ to be consistent with other VCSs Andy Parkins
2007-05-14 14:19     ` Johannes Sixt
2007-05-14 14:39       ` Andy Parkins
2007-05-14 14:54       ` Junio C Hamano
2007-05-14 22:24         ` Andy Parkins
2007-05-15  0:17           ` Junio C Hamano
2007-05-15  2:03           ` Junio C Hamano [this message]
2007-05-15  8:14             ` Andy Parkins
2007-05-15  8:54               ` Junio C Hamano
2007-05-15 10:34                 ` Andy Parkins
2007-05-17 13:53 ` [PATCH] Allow the ident attribute to include a length specifier Andy Parkins
2007-05-17 19:55   ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7vmz06lu7d.fsf@assigned-by-dhcp.cox.net \
    --to=junkio@cox.net \
    --cc=J.Sixt@eudaptics.com \
    --cc=andyparkins@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.