{"thread":{"id":"849","subject":"[PATCH] git-diff-cache: handle pathspec beginning with a dash","startedAt":"2005-06-06T21:27:00Z","lastAt":"2005-06-08T20:13:52Z","messageCount":6,"participants":["Jonas Fonseca","Petr Baudis","Linus Torvalds"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"4658","messageId":"20050606212700.GA3498@diku.dk","threadId":"849","inReplyTo":null,"subject":"[PATCH] git-diff-cache: handle pathspec beginning with a dash","fromName":"Jonas Fonseca","fromEmail":"fonseca@diku.dk","sentAt":"2005-06-06T21:27:00Z","receivedAt":"2005-06-06T21:27:00Z","isPatch":true,"sender":{"key":"fonseca@diku.dk","avatar":"https://gravatar.com/avatar/f82f3ad698717c51873b020c750a92438c820a24056dc39fe4d07baa10a92264?d=mp&s=160"},"body":"Parse everything after '--' as tree name or pathspec.\n\nSigned-off-by: Jonas Fonseca <fonseca@diku.dk>\n---\n\n diff-cache.c |    7 ++++++-\n 1 files changed, 6 insertions(+), 1 deletions(-)\n\ndiff --git a/diff-cache.c b/diff-cache.c\n--- a/diff-cache.c\n+++ b/diff-cache.c\n@@ -167,13 +167,14 @@ int main(int argc, const char **argv)\n \tvoid *tree;\n \tunsigned long size;\n \tint ret;\n+\tint allow_options = 1;\n \tint i;\n \n \tread_cache();\n \tfor (i = 1; i < argc; i++) {\n \t\tconst char *arg = argv[i];\n \n-\t\tif (*arg != '-') {\n+\t\tif (!allow_options || *arg != '-') {\n \t\t\tif (tree_name) {\n \t\t\t\tpathspec = argv + i;\n \t\t\t\tbreak;\n@@ -182,6 +183,10 @@ int main(int argc, const char **argv)\n \t\t\tcontinue;\n \t\t}\n \t\t\t\n+\t\tif (!strcmp(arg, \"--\")) {\n+\t\t\tallow_options = 0;\n+\t\t\tcontinue;\n+\t\t}\n \t\tif (!strcmp(arg, \"-r\")) {\n \t\t\t/* We accept the -r flag just to look like git-diff-tree */\n \t\t\tcontinue;\n-- \nJonas Fonseca\n"},{"id":"4659","messageId":"20050606213252.GB3498@diku.dk","threadId":"849","inReplyTo":"20050606212700.GA3498@diku.dk","subject":"[PATCH] cg-commit: prefix pathspec argument with --","fromName":"Jonas Fonseca","fromEmail":"fonseca@diku.dk","sentAt":"2005-06-06T21:32:52Z","receivedAt":"2005-06-06T21:32:52Z","isPatch":true,"sender":{"key":"fonseca@diku.dk","avatar":"https://gravatar.com/avatar/f82f3ad698717c51873b020c750a92438c820a24056dc39fe4d07baa10a92264?d=mp&s=160"},"body":"Make cg-commit handle files beginning with dashes.\n\nSigned-off-by: Jonas Fonseca <fonseca@diku.dk>\n---\n\n[ Obviously depends on the patch I sent previously. ]\n\n cg-commit |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/cg-commit b/cg-commit\n--- a/cg-commit\n+++ b/cg-commit\n@@ -110,7 +110,7 @@ if [ \"$1\" ]; then\n \t[ \"$ignorecache\" ] && die \"-C and listing files to commit does not make sense\"\n \t[ -s $_git/merging ] && die \"cannot commit individual files when merging\"\n \n-\teval commitfiles=($(git-diff-cache -r -m HEAD \"$@\" | \\\n+\teval commitfiles=($(git-diff-cache -r -m HEAD -- \"$@\" | \\\n \t\tsed 's/^\\([^\t]*\\)\\(.\t.*\\)\\(\t.*\\)*$/\"\\2\"/'))\n \tcustomfiles=1\n \n-- \nJonas Fonseca\n"},{"id":"4711","messageId":"20050608184709.GE982@pasky.ji.cz","threadId":"849","inReplyTo":"20050606212700.GA3498@diku.dk","subject":"Re: [PATCH] git-diff-cache: handle pathspec beginning with a dash","fromName":"Petr Baudis","fromEmail":"pasky@ucw.cz","sentAt":"2005-06-08T18:47:09Z","receivedAt":"2005-06-08T18:47:09Z","isPatch":true,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"Dear diary, on Mon, Jun 06, 2005 at 11:27:00PM CEST, I got a letter\nwhere Jonas Fonseca <fonseca@diku.dk> told me that...\n> Parse everything after '--' as tree name or pathspec.\n> \n> Signed-off-by: Jonas Fonseca <fonseca@diku.dk>\n\nThanks, applied to git-pb. Linus, any particular reason for holding this\noff?\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":"4717","messageId":"Pine.LNX.4.58.0506081259580.2286@ppc970.osdl.org","threadId":"849","inReplyTo":"20050608184709.GE982@pasky.ji.cz","subject":"Re: [PATCH] git-diff-cache: handle pathspec beginning with a dash","fromName":"Linus Torvalds","fromEmail":"torvalds@osdl.org","sentAt":"2005-06-08T20:00:48Z","receivedAt":"2005-06-08T20:00:48Z","isPatch":true,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Wed, 8 Jun 2005, Petr Baudis wrote:\n>\n> Dear diary, on Mon, Jun 06, 2005 at 11:27:00PM CEST, I got a letter\n> where Jonas Fonseca <fonseca@diku.dk> told me that...\n> > Parse everything after '--' as tree name or pathspec.\n> > \n> > Signed-off-by: Jonas Fonseca <fonseca@diku.dk>\n> \n> Thanks, applied to git-pb. Linus, any particular reason for holding this\n> off?\n\nIt seems to have gone only to the mailing list. I only glance through the \nlists, and assume that if somebody wants me to apply a patch, they'll cc \nme personally too..\n\n\t\tLinus\n"},{"id":"4718","messageId":"20050608200612.GM982@pasky.ji.cz","threadId":"849","inReplyTo":"Pine.LNX.4.58.0506081259580.2286@ppc970.osdl.org","subject":"Re: [PATCH] git-diff-cache: handle pathspec beginning with a dash","fromName":"Petr Baudis","fromEmail":"pasky@ucw.cz","sentAt":"2005-06-08T20:06:12Z","receivedAt":"2005-06-08T20:06:12Z","isPatch":true,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"Dear diary, on Wed, Jun 08, 2005 at 10:00:48PM CEST, I got a letter\nwhere Linus Torvalds <torvalds@osdl.org> told me that...\n> \n> \n> On Wed, 8 Jun 2005, Petr Baudis wrote:\n> >\n> > Dear diary, on Mon, Jun 06, 2005 at 11:27:00PM CEST, I got a letter\n> > where Jonas Fonseca <fonseca@diku.dk> told me that...\n> > > Parse everything after '--' as tree name or pathspec.\n> > > \n> > > Signed-off-by: Jonas Fonseca <fonseca@diku.dk>\n> > \n> > Thanks, applied to git-pb. Linus, any particular reason for holding this\n> > off?\n> \n> It seems to have gone only to the mailing list. I only glance through the \n> lists, and assume that if somebody wants me to apply a patch, they'll cc \n> me personally too..\n\nI see. Jonas mentioned on IRC that he forgot to Cc' you. I'm usually\ngoing through everything on the mailing list, so if some patch stays out\nfor few days I'll start nagging. ;-)\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":"4719","messageId":"Pine.LNX.4.58.0506081312410.2286@ppc970.osdl.org","threadId":"849","inReplyTo":"20050608200612.GM982@pasky.ji.cz","subject":"Re: [PATCH] git-diff-cache: handle pathspec beginning with a dash","fromName":"Linus Torvalds","fromEmail":"torvalds@osdl.org","sentAt":"2005-06-08T20:13:52Z","receivedAt":"2005-06-08T20:13:52Z","isPatch":true,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Wed, 8 Jun 2005, Petr Baudis wrote:\n> \n> I see. Jonas mentioned on IRC that he forgot to Cc' you. I'm usually\n> going through everything on the mailing list, so if some patch stays out\n> for few days I'll start nagging. ;-)\n\nEven better, just forward it to me with the original author as \"From:\" at\nthe top of the email, and an added sign-off by you, and it will show which\npath it took.\n\nI took the two patches you pointed out from the mailing list, so they're \nin my archives now.\n\n\t\tLinus\n"}]}