{"thread":{"id":"85","subject":"[patch] fork optional branch point normazilation","startedAt":"2005-04-17T12:04:16Z","lastAt":"2005-04-18T10:45:19Z","messageCount":12,"participants":["Brad Roberts","Petr Baudis","Linus Torvalds","Daniel Barkalow","Junio C Hamano","Martin Schlemmer"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"467","messageId":"Pine.LNX.4.44.0504170451030.2625-100000@bellevue.puremagic.com","threadId":"85","inReplyTo":null,"subject":"[patch] fork optional branch point normazilation","fromName":"Brad Roberts","fromEmail":"braddr@puremagic.com","sentAt":"2005-04-17T12:04:16Z","receivedAt":"2005-04-17T12:04:16Z","isPatch":true,"sender":{"key":"braddr@puremagic.com","avatar":null},"body":"(ok, author looks better, but committer doesn't obey the AUTHOR_ vars yet)\n\nThis might not be how you intended git fork to behave, but without doing\n_something_ to protect the head parameter a bit, this is just asking for a\ncorrutped .git/HEAD file.\n\ncommit 76faec069dfeae59c3ce5faaad10bdcded0cc908\ntree c291316b28eff4042c80850cd93445345a606835\nparent 1cdbc0a19b8d9b68f1f42735e2f14f1289823a63\nauthor Brad Roberts <braddr@puremagic.com> 1113738584 -0700\ncommitter Brad Roberts,,, <braddr@gameboy2> 1113738584 -0700\n\ngitfork needs to normalize the optional third parameter before using it.\n\nIndex: gitfork.sh\n===================================================================\n--- 51b1bddbbc05e50d5bbf1f9662e503c2e85d5e96/gitfork.sh  (mode:100755 sha1:e5692ea9bdbc39b028fe1e1205381da632541bab)\n+++ c291316b28eff4042c80850cd93445345a606835/gitfork.sh  (mode:100755 sha1:386148ae9a99739d06a09742ff4157d0f7e4e223)\n@@ -37,6 +37,7 @@\n [ -e \"$destdir\" ] && die \"$destdir already exists\"\n\n [ \"$head\" ] || head=$(commit-id)\n+head=$(gitXnormid.sh -c $head)\n\n git lntree \"$destdir\"\n echo $head >.git/heads/$name\n\n\n\n"},{"id":"469","messageId":"20050417122534.GD1487@pasky.ji.cz","threadId":"85","inReplyTo":"Pine.LNX.4.44.0504170451030.2625-100000@bellevue.puremagic.com","subject":"Re: fork optional branch point normazilation","fromName":"Petr Baudis","fromEmail":"pasky@ucw.cz","sentAt":"2005-04-17T12:25:34Z","receivedAt":"2005-04-17T12:25:34Z","isPatch":false,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"Dear diary, on Sun, Apr 17, 2005 at 02:04:16PM CEST, I got a letter\nwhere Brad Roberts <braddr@puremagic.com> told me that...\n> This might not be how you intended git fork to behave, but without doing\n> _something_ to protect the head parameter a bit, this is just asking for a\n> corrutped .git/HEAD file.\n> \n> commit 76faec069dfeae59c3ce5faaad10bdcded0cc908\n> tree c291316b28eff4042c80850cd93445345a606835\n> parent 1cdbc0a19b8d9b68f1f42735e2f14f1289823a63\n> author Brad Roberts <braddr@puremagic.com> 1113738584 -0700\n> committer Brad Roberts,,, <braddr@gameboy2> 1113738584 -0700\n> \n> gitfork needs to normalize the optional third parameter before using it.\n> \n> Index: gitfork.sh\n> ===================================================================\n> --- 51b1bddbbc05e50d5bbf1f9662e503c2e85d5e96/gitfork.sh  (mode:100755 sha1:e5692ea9bdbc39b028fe1e1205381da632541bab)\n> +++ c291316b28eff4042c80850cd93445345a606835/gitfork.sh  (mode:100755 sha1:386148ae9a99739d06a09742ff4157d0f7e4e223)\n> @@ -37,6 +37,7 @@\n>  [ -e \"$destdir\" ] && die \"$destdir already exists\"\n> \n>  [ \"$head\" ] || head=$(commit-id)\n> +head=$(gitXnormid.sh -c $head)\n> \n>  git lntree \"$destdir\"\n>  echo $head >.git/heads/$name\n\ncommit-id always returns the normalized commit ID.\n\n-- \n\t\t\t\tPetr \"Pasky\" Baudis\nStuff: http://pasky.or.cz/\nC++: an octopus made by nailing extra legs onto a dog. -- Steve Taylor\n"},{"id":"470","messageId":"Pine.LNX.4.44.0504170530080.2625-100000@bellevue.puremagic.com","threadId":"85","inReplyTo":"20050417122534.GD1487@pasky.ji.cz","subject":"Re: fork optional branch point normazilation","fromName":"Brad Roberts","fromEmail":"braddr@puremagic.com","sentAt":"2005-04-17T12:40:59Z","receivedAt":"2005-04-17T12:40:59Z","isPatch":false,"sender":{"key":"braddr@puremagic.com","avatar":null},"body":"> >\n> > Index: gitfork.sh\n> > ===================================================================\n> > --- 51b1bddbbc05e50d5bbf1f9662e503c2e85d5e96/gitfork.sh  (mode:100755 sha1:e5692ea9bdbc39b028fe1e1205381da632541bab)\n> > +++ c291316b28eff4042c80850cd93445345a606835/gitfork.sh  (mode:100755 sha1:386148ae9a99739d06a09742ff4157d0f7e4e223)\n> > @@ -37,6 +37,7 @@\n> >  [ -e \"$destdir\" ] && die \"$destdir already exists\"\n> >\n> >  [ \"$head\" ] || head=$(commit-id)\n> > +head=$(gitXnormid.sh -c $head)\n> >\n> >  git lntree \"$destdir\"\n> >  echo $head >.git/heads/$name\n>\n> commit-id always returns the normalized commit ID.\n>\n> --\n> \t\t\t\tPetr \"Pasky\" Baudis\n> Stuff: http://pasky.or.cz/\n> C++: an octopus made by nailing extra legs onto a dog. -- Steve Taylor\n>\n\nThis feels better to me.  Diffed against my previus commit.  The problem\nwas that commit-id wasn't called if a branch point was specified nor was\nthat value checked for validity.\n\nIndex: gitfork.sh\n===================================================================\n--- c9ccaa172ccab8e56f2fe621ee24896bfddacf26/gitfork.sh  (mode:100755 sha1:386148ae9a99739d06a09742ff4157d0f7e4e223)\n+++ f9e06a309f63ac6858d019b51f2172283378d2ef/gitfork.sh  (mode:100755 sha1:dbb508b8431368fc95cc9516eada52f5bf0f8bc1)\n@@ -16,7 +16,7 @@\n\n name=$1\n destdir=$2\n-head=$3\n+head=$(gitXnormid.sh -c $3)\n\n die () {\n        echo gitfork.sh: $@ >&2\n@@ -36,9 +36,6 @@\n\n [ -e \"$destdir\" ] && die \"$destdir already exists\"\n\n-[ \"$head\" ] || head=$(commit-id)\n-head=$(gitXnormid.sh -c $head)\n-\n git lntree \"$destdir\"\n echo $head >.git/heads/$name\n ln -s heads/$name \"$destdir/.git/HEAD\"\n\n"},{"id":"503","messageId":"Pine.LNX.4.58.0504171005220.7211@ppc970.osdl.org","threadId":"85","inReplyTo":"Pine.LNX.4.44.0504170451030.2625-100000@bellevue.puremagic.com","subject":"Re: [patch] fork optional branch point normazilation","fromName":"Linus Torvalds","fromEmail":"torvalds@osdl.org","sentAt":"2005-04-17T17:13:29Z","receivedAt":"2005-04-17T17:13:29Z","isPatch":true,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Sun, 17 Apr 2005, Brad Roberts wrote:\n>\n> (ok, author looks better, but committer doesn't obey the AUTHOR_ vars yet)\n\nThey should't, but maybe I should add COMMITTER_xxx overrides. I just do \n_not_ want people to think that they should claim to be somebody else: \nit's not a security issue (you could compile your own \"commit-tree.c\" \nafter all), it's more of a \"social rule\" thing. I prefer seeing bad email \naddresses that at least match the system setup to seeing good email \naddresses that people made up just to make them look clean.\n\nMind showing what your /etc/passwd file looks like (just your own entry, \nand please just remove your password entry if you don't use shadow \npasswords).\n\nMaybe I should just remove _all_ strange characters when I do the name \ncleanup in \"commit\". Right now I just remove the ones that matter to \nparsing it unambiguosly: '\\n' '<' and '>'.\n\n(The ',' character really is special: some people have\n\n\tTorvalds, Linus\n\nand maybe I should not just remove the commas, I should convert it to \nalways be \"Linus Torvalds\". But your gecos entry is just _strange_. Why \nthe extra commas, I wonder?)\n\n\t\tLinus\n"},{"id":"504","messageId":"Pine.LNX.4.21.0504171313300.30848-100000@iabervon.org","threadId":"85","inReplyTo":"Pine.LNX.4.58.0504171005220.7211@ppc970.osdl.org","subject":"Re: [patch] fork optional branch point normazilation","fromName":"Daniel Barkalow","fromEmail":"barkalow@iabervon.org","sentAt":"2005-04-17T17:21:27Z","receivedAt":"2005-04-17T17:21:27Z","isPatch":true,"sender":{"key":"barkalow@iabervon.org","avatar":"https://avatars.githubusercontent.com/u/55364219?v=4"},"body":"On Sun, 17 Apr 2005, Linus Torvalds wrote:\n\n> On Sun, 17 Apr 2005, Brad Roberts wrote:\n> >\n> > (ok, author looks better, but committer doesn't obey the AUTHOR_ vars yet)\n> \n> They should't, but maybe I should add COMMITTER_xxx overrides. I just do \n> _not_ want people to think that they should claim to be somebody else: \n> it's not a security issue (you could compile your own \"commit-tree.c\" \n> after all), it's more of a \"social rule\" thing. I prefer seeing bad email \n> addresses that at least match the system setup to seeing good email \n> addresses that people made up just to make them look clean.\n\nIt seems to me like there should be a set of variables for the user in\ngeneral, and the various git scripts should arrange them appropriately\n(e.g., git apply could look for a first Signed-Off-By, and make the\nAUTHOR_ variables match that (for the next commit), while making the\nCOMMITTER match the user, etc). It seems to me like the current situation\nis likely to lead to people claiming to be other people when applying\ntheir patches, just due to having set up their correct info for handling\ntheir own patches.\n\nActually, if the scripts are reorganizing them, they might as well send\nthem on the command line.\n\n\t-Daniel\n*This .sig left intentionally blank*\n\n"},{"id":"568","messageId":"Pine.LNX.4.44.0504171614150.2625-100000@bellevue.puremagic.com","threadId":"85","inReplyTo":"Pine.LNX.4.58.0504171005220.7211@ppc970.osdl.org","subject":"Re: [patch] fork optional branch point normazilation","fromName":"Brad Roberts","fromEmail":"braddr@puremagic.com","sentAt":"2005-04-17T23:27:31Z","receivedAt":"2005-04-17T23:27:31Z","isPatch":true,"sender":{"key":"braddr@puremagic.com","avatar":null},"body":"On Sun, 17 Apr 2005, Linus Torvalds wrote:\n\n> On Sun, 17 Apr 2005, Brad Roberts wrote:\n> >\n> > (ok, author looks better, but committer doesn't obey the AUTHOR_ vars yet)\n>\n> They should't, but maybe I should add COMMITTER_xxx overrides. I just do\n> _not_ want people to think that they should claim to be somebody else:\n> it's not a security issue (you could compile your own \"commit-tree.c\"\n> after all), it's more of a \"social rule\" thing. I prefer seeing bad email\n> addresses that at least match the system setup to seeing good email\n> addresses that people made up just to make them look clean.\n>\n> Mind showing what your /etc/passwd file looks like (just your own entry,\n> and please just remove your password entry if you don't use shadow\n> passwords).\n>\n> Maybe I should just remove _all_ strange characters when I do the name\n> cleanup in \"commit\". Right now I just remove the ones that matter to\n> parsing it unambiguosly: '\\n' '<' and '>'.\n>\n> (The ',' character really is special: some people have\n>\n> \tTorvalds, Linus\n>\n> and maybe I should not just remove the commas, I should convert it to\n> always be \"Linus Torvalds\". But your gecos entry is just _strange_. Why\n> the extra commas, I wonder?)\n>\n> \t\tLinus\n> -\n\nI fully agree with the intent of the field separation, they're two very\ndifferent activities.\n\nbraddr:x:1000:1000:Brad Roberts,,,:/home/braddr:/bin/bash\n\nAll gecos entries on all my debian boxes are of the form:\n\n   fullname, office number, office extension, and home number\n\nThis is taken from the chfn man page on debian.  Looking on my nearest\nredhat box, the chfn man page is roughly the same.  Debian's man page also\nhas one snippit that's not in redhat's, suggested delimiter is a ','.  A\nbit of searching for other platforms, aix suggests a ';' as a delimiter.\nHPUX seems to want a ','.\n\nLater,\nBrad\n\n"},{"id":"573","messageId":"Pine.LNX.4.58.0504171636590.7211@ppc970.osdl.org","threadId":"85","inReplyTo":"Pine.LNX.4.44.0504171614150.2625-100000@bellevue.puremagic.com","subject":"Re: [patch] fork optional branch point normazilation","fromName":"Linus Torvalds","fromEmail":"torvalds@osdl.org","sentAt":"2005-04-17T23:39:10Z","receivedAt":"2005-04-17T23:39:10Z","isPatch":true,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Sun, 17 Apr 2005, Brad Roberts wrote:\n>\n> braddr:x:1000:1000:Brad Roberts,,,:/home/braddr:/bin/bash\n> \n> All gecos entries on all my debian boxes are of the form:\n> \n>    fullname, office number, office extension, and home number\n\nAhh, ok.\n\nI'll make the \"cleanup\" thing just remove strange characters from the end, \nthat should fix this kind of thing for now.\n\nI'd just remove everything after the first strange number, but I can also \nsee people using the \"lastname, firstname\" format, and I'd hate to just \nignore firstname in that case.\n\n\t\tLinus\n"},{"id":"580","messageId":"20050418002326.GC1461@pasky.ji.cz","threadId":"85","inReplyTo":"Pine.LNX.4.58.0504171636590.7211@ppc970.osdl.org","subject":"Re: [patch] fork optional branch point normazilation","fromName":"Petr Baudis","fromEmail":"pasky@ucw.cz","sentAt":"2005-04-18T00:23:26Z","receivedAt":"2005-04-18T00:23:26Z","isPatch":true,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"Dear diary, on Mon, Apr 18, 2005 at 01:39:10AM CEST, I got a letter\nwhere Linus Torvalds <torvalds@osdl.org> told me that...\n> \n> \n> On Sun, 17 Apr 2005, Brad Roberts wrote:\n> >\n> > braddr:x:1000:1000:Brad Roberts,,,:/home/braddr:/bin/bash\n> > \n> > All gecos entries on all my debian boxes are of the form:\n> > \n> >    fullname, office number, office extension, and home number\n> \n> Ahh, ok.\n> \n> I'll make the \"cleanup\" thing just remove strange characters from the end, \n> that should fix this kind of thing for now.\n> \n> I'd just remove everything after the first strange number, but I can also \n> see people using the \"lastname, firstname\" format, and I'd hate to just \n> ignore firstname in that case.\n\n> +       /*\n> +        * Go back, and remove crud from the end: some people\n> +        * have commas etc in their gecos field\n> +        */\n> +       dst--;\n> +       while (--dst >= p) {\n> +               unsigned char c = *dst;\n> +               switch (c) {\n> +               case ',': case ';': case '.':\n> +                       *dst = 0;\n> +                       continue;\n> +               }\n> +               break;\n> +       }\n\nAm I just slow or does the first dst-- make it miss the last trailing\n/[,;.]/?\n\n-- \n\t\t\t\tPetr \"Pasky\" Baudis\nStuff: http://pasky.or.cz/\nC++: an octopus made by nailing extra legs onto a dog. -- Steve Taylor\n"},{"id":"589","messageId":"Pine.LNX.4.58.0504171806230.7211@ppc970.osdl.org","threadId":"85","inReplyTo":"20050418002326.GC1461@pasky.ji.cz","subject":"Re: [patch] fork optional branch point normazilation","fromName":"Linus Torvalds","fromEmail":"torvalds@osdl.org","sentAt":"2005-04-18T01:07:18Z","receivedAt":"2005-04-18T01:07:18Z","isPatch":true,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Mon, 18 Apr 2005, Petr Baudis wrote:\n> \n> Am I just slow or does the first dst-- make it miss the last trailing\n> /[,;.]/?\n\nHopefully not. It _should_ make it miss the last '\\0', but hey, it got my\nusual amount of testing (ie none). I'm sure Brad can tell us whether it\nmakes any difference..\n\n\t\tLinus\n"},{"id":"599","messageId":"7voeccvom1.fsf_-_@assigned-by-dhcp.cox.net","threadId":"85","inReplyTo":"Pine.LNX.4.58.0504171806230.7211@ppc970.osdl.org","subject":"[PATCH] remove_special() tentative fix.","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-04-18T01:51:34Z","receivedAt":"2005-04-18T01:51:34Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":">>>>> \"LT\" == Linus Torvalds <torvalds@osdl.org> writes:\n\nLT> On Mon, 18 Apr 2005, Petr Baudis wrote:\n>> \n>> Am I just slow or does the first dst-- make it miss the last trailing\n>> /[,;.]/?\n\nLT> Hopefully not. It _should_ make it miss the last '\\0', but hey, it got my\nLT> usual amount of testing (ie none). I'm sure Brad can tell us whether it\nLT> makes any difference..\n\nNo, you are both slow ;-)  At that point p is not the beginning\nof the input anymore.  This is a *tentative* fix to implement\nyour intended solution.\n\nI have a suspicion that your intended solution would not work on\nsystems that really use these GECOS subfields, though.  These\ncommas are there to separate subfields and your intended\nsolution would keep the office numbers etc. as part of commiter\nname.  Honestly, I think your COMMITTER_* environment variable\nidea is far better than playing games like this, although at the\nsame time I sympathize your not wanting to encourage people to\nlie about the committer identity.\n\nSigned-off-by: Junio C Hamano <junkio@cox.net> \n---\n\ncd /opt/packrat/playpen/public/in-place/git/git/\nshow-diff commit-tree.c\ncommit-tree.c: ec53a4565ec0033aaf6df2a48d233ccf4823e8b0\n--- commit-tree.c\n+++ commit-tree.c\t2005-04-17 18:43:39.000000000 -0700\n@@ -83,6 +83,7 @@ static void finish_buffer(char *tag, cha\n static void remove_special(char *p)\n {\n \tchar c;\n+\tchar *begin = p;\n \tchar *dst = p;\n \n \tfor (;;) {\n@@ -102,7 +103,7 @@ static void remove_special(char *p)\n \t * have commas etc in their gecos field\n \t */\n \tdst--;\n-\twhile (--dst >= p) {\n+\twhile (--dst >= begin) {\n \t\tunsigned char c = *dst;\n \t\tswitch (c) {\n \t\tcase ',': case ';': case '.':\n\nCompilation finished at Sun Apr 17 18:44:55\n\n"},{"id":"601","messageId":"Pine.LNX.4.44.0504171859410.2625-100000@bellevue.puremagic.com","threadId":"85","inReplyTo":"Pine.LNX.4.58.0504171806230.7211@ppc970.osdl.org","subject":"Re: [patch] fork optional branch point normazilation","fromName":"Brad Roberts","fromEmail":"braddr@puremagic.com","sentAt":"2005-04-18T02:01:53Z","receivedAt":"2005-04-18T02:01:53Z","isPatch":true,"sender":{"key":"braddr@puremagic.com","avatar":null},"body":"The patch needed some tweaking, but not in the way you thought. :)\n\ncommit a6aa192641e9ea242332fee4916abf5ad2640d75\ntree c69878b009ec2f505d75aa7d99e9ee30cd21ab02\nparent 60e1274460f50bcecdc3f162b4fced9e5ebf2dfb\nauthor Brad Roberts <braddr@puremagic.com> 1113789519 -0700\ncommitter Brad Roberts <braddr@gameboy2> 1113789519 -0700\n\nFix remove_specials for real.  The second half logic needs the original\nhead of the string.\n\nSigned-off-by: Brad Roberts <braddr@puremagic.com>\n\nIndex: commit-tree.c\n===================================================================\n--- 02cf6917da6297ff4f9172f7af174ba329f01b3d/commit-tree.c  (mode:100644 sha1:ec53a4565ec0033aaf6df2a48d233ccf4823e8b0)\n+++ c69878b009ec2f505d75aa7d99e9ee30cd21ab02/commit-tree.c  (mode:100644 sha1:f41cda6f9496b9e33cb95305ef1093f846c663ae)\n@@ -83,11 +83,11 @@\n static void remove_special(char *p)\n {\n        char c;\n-       char *dst = p;\n+       char *dst = p, *src = p;\n\n        for (;;) {\n-               c = *p;\n-               p++;\n+               c = *src;\n+               src++;\n                switch(c) {\n                case '\\n': case '<': case '>':\n                        continue;\n\n\nLater,\nBrad\n\n"},{"id":"644","messageId":"1113821119.16288.13.camel@nosferatu.lan","threadId":"85","inReplyTo":"Pine.LNX.4.58.0504171636590.7211@ppc970.osdl.org","subject":"Re: [patch] fork optional branch point normazilation","fromName":"Martin Schlemmer","fromEmail":"azarah@nosferatu.za.org","sentAt":"2005-04-18T10:45:19Z","receivedAt":"2005-04-18T10:45:19Z","isPatch":true,"sender":{"key":"azarah@nosferatu.za.org","avatar":null},"body":"On Sun, 2005-04-17 at 16:39 -0700, Linus Torvalds wrote:\n> \n> On Sun, 17 Apr 2005, Brad Roberts wrote:\n> >\n> > braddr:x:1000:1000:Brad Roberts,,,:/home/braddr:/bin/bash\n> > \n> > All gecos entries on all my debian boxes are of the form:\n> > \n> >    fullname, office number, office extension, and home number\n> \n> Ahh, ok.\n> \n> I'll make the \"cleanup\" thing just remove strange characters from the end, \n> that should fix this kind of thing for now.\n> \n> I'd just remove everything after the first strange number, but I can also \n> see people using the \"lastname, firstname\" format, and I'd hate to just \n> ignore firstname in that case.\n> \n\nIf we get the info from /etc/passwd, then we should just use whatever\nbefore the first [,;] (see patch I posted earlier).  If not, then I\nthink AUTHOR_* should be sane).\n\n\n-- \nMartin Schlemmer\n\n"}]}