git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] remove_special() tentative fix.

From
Junio C Hamano <junkio@cox.net>
Date
Apr 18, 2005, 01:51 UTC
Message-ID
<7voeccvom1.fsf_-_@assigned-by-dhcp.cox.net>
In-Reply-To
<Pine.LNX.4.58.0504171806230.7211@ppc970.osdl.org>
>>>>> "LT" == Linus Torvalds <torvalds@osdl.org> writes:
LT> On Mon, 18 Apr 2005, Petr Baudis wrote:
>> 
>> Am I just slow or does the first dst-- make it miss the last trailing
>> /[,;.]/?

LT> Hopefully not. It _should_ make it miss the last '\0', but hey, it got my LT> usual amount of testing (ie none). I'm sure Brad can tell us whether it LT> makes any difference..

No, you are both slow ;-) At that point p is not the beginning of the input anymore. This is a *tentative* fix to implement your intended solution.

I have a suspicion that your intended solution would not work on systems that really use these GECOS subfields, though. These commas are there to separate subfields and your intended solution would keep the office numbers etc. as part of commiter name. Honestly, I think your COMMITTER_* environment variable idea is far better than playing games like this, although at the same time I sympathize your not wanting to encourage people to lie about the committer identity.

Signed-off-by: Junio C Hamano <junkio@cox.net> 
---

cd /opt/packrat/playpen/public/in-place/git/git/ show-diff commit-tree.c commit-tree.c: ec53a4565ec0033aaf6df2a48d233ccf4823e8b0 --- commit-tree.c +++ commit-tree.c 2005-04-17 18:43:39.000000000 -0700

@@ -83,6 +83,7 @@ static void finish_buffer(char *tag, cha
 static void remove_special(char *p)
 {
 	char c;
+	char *begin = p;
 	char *dst = p;
 
 	for (;;) {
@@ -102,7 +103,7 @@ static void remove_special(char *p)
 	 * have commas etc in their gecos field
 	 */
 	dst--;
-	while (--dst >= p) {
+	while (--dst >= begin) {
 		unsigned char c = *dst;
 		switch (c) {
 		case ',': case ';': case '.':

Compilation finished at Sun Apr 17 18:44:55
Previous: Linus TorvaldsNext: Brad Roberts
Message 10 of 12 in “fork optional branch point normazilation”
  1. fork optional branch point normazilationBrad Roberts, Apr 17, 2005
  2. Petr BaudisApr 17, 2005
  3. Brad RobertsApr 17, 2005
  4. Linus TorvaldsApr 17, 2005
  5. Daniel BarkalowApr 17, 2005
  6. Brad RobertsApr 17, 2005
  7. Linus TorvaldsApr 17, 2005
  8. Petr BaudisApr 18, 2005
  9. Linus TorvaldsApr 18, 2005
  10. remove_special() tentative fix.Junio C Hamano, Apr 18, 2005
  11. Brad RobertsApr 18, 2005
  12. Martin SchlemmerApr 18, 2005

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.