{"thread":{"id":"36200","subject":"[PATCH] Add grep.fullName config variable","startedAt":"2014-03-17T19:16:05Z","lastAt":"2014-03-18T20:16:35Z","messageCount":7,"participants":["Andreas Schwab","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"236900","messageId":"874n2w3abu.fsf@igel.home","threadId":"36200","inReplyTo":null,"subject":"[PATCH] Add grep.fullName config variable","fromName":"Andreas Schwab","fromEmail":"schwab@linux-m68k.org","sentAt":"2014-03-17T19:16:05Z","receivedAt":"2014-03-17T19:16:05Z","isPatch":true,"sender":{"key":"schwab@linux-m68k.org","avatar":"https://avatars.githubusercontent.com/u/2175493?v=4"},"body":"This configuration variable sets the default for the --full-name option.\n\nSigned-off-by: Andreas Schwab <schwab@linux-m68k.org>\n---\n Documentation/git-grep.txt | 3 +++\n grep.c                     | 5 +++++\n 2 files changed, 8 insertions(+)\n\ndiff --git a/Documentation/git-grep.txt b/Documentation/git-grep.txt\nindex f837334..31811f1 100644\n--- a/Documentation/git-grep.txt\n+++ b/Documentation/git-grep.txt\n@@ -53,6 +53,9 @@ grep.extendedRegexp::\n \toption is ignored when the 'grep.patternType' option is set to a value\n \tother than 'default'.\n \n+grep.fullName::\n+\tIf set to true, enable '--full-name' option by default.\n+\n \n OPTIONS\n -------\ndiff --git a/grep.c b/grep.c\nindex c668034..ece04bf 100644\n--- a/grep.c\n+++ b/grep.c\n@@ -86,6 +86,11 @@ int grep_config(const char *var, const char *value, void *cb)\n \t\treturn 0;\n \t}\n \n+\tif (!strcmp(var, \"grep.fullname\")) {\n+\t\topt->relative = !git_config_bool(var, value);\n+\t\treturn 0;\n+\t}\n+\n \tif (!strcmp(var, \"color.grep\"))\n \t\topt->color = git_config_colorbool(var, value);\n \telse if (!strcmp(var, \"color.grep.context\"))\n-- \n1.9.0\n\n-- \nAndreas Schwab, schwab@linux-m68k.org\nGPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5\n\"And now for something completely different.\"\n"},{"id":"236931","messageId":"xmqq7g7sbh56.fsf@gitster.dls.corp.google.com","threadId":"36200","inReplyTo":"874n2w3abu.fsf@igel.home","subject":"Re: [PATCH] Add grep.fullName config variable","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-03-17T22:21:41Z","receivedAt":"2014-03-17T22:21:41Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Andreas Schwab <schwab@linux-m68k.org> writes:\n\n> This configuration variable sets the default for the --full-name option.\n>\n> Signed-off-by: Andreas Schwab <schwab@linux-m68k.org>\n> ---\n\nWould this change break Porcelains (e.g. Emacs modes) and force them\nto be updated to explicitly pass --no-full-name to unbreak them?\n\n>  Documentation/git-grep.txt | 3 +++\n>  grep.c                     | 5 +++++\n>  2 files changed, 8 insertions(+)\n>\n> diff --git a/Documentation/git-grep.txt b/Documentation/git-grep.txt\n> index f837334..31811f1 100644\n> --- a/Documentation/git-grep.txt\n> +++ b/Documentation/git-grep.txt\n> @@ -53,6 +53,9 @@ grep.extendedRegexp::\n>  \toption is ignored when the 'grep.patternType' option is set to a value\n>  \tother than 'default'.\n>  \n> +grep.fullName::\n> +\tIf set to true, enable '--full-name' option by default.\n> +\n>  \n>  OPTIONS\n>  -------\n> diff --git a/grep.c b/grep.c\n> index c668034..ece04bf 100644\n> --- a/grep.c\n> +++ b/grep.c\n> @@ -86,6 +86,11 @@ int grep_config(const char *var, const char *value, void *cb)\n>  \t\treturn 0;\n>  \t}\n>  \n> +\tif (!strcmp(var, \"grep.fullname\")) {\n> +\t\topt->relative = !git_config_bool(var, value);\n> +\t\treturn 0;\n> +\t}\n> +\n>  \tif (!strcmp(var, \"color.grep\"))\n>  \t\topt->color = git_config_colorbool(var, value);\n>  \telse if (!strcmp(var, \"color.grep.context\"))\n> -- \n> 1.9.0\n"},{"id":"236978","messageId":"mvmy507stf1.fsf@hawking.suse.de","threadId":"36200","inReplyTo":"xmqq7g7sbh56.fsf@gitster.dls.corp.google.com","subject":"Re: [PATCH] Add grep.fullName config variable","fromName":"Andreas Schwab","fromEmail":"schwab@linux-m68k.org","sentAt":"2014-03-18T10:16:50Z","receivedAt":"2014-03-18T10:16:50Z","isPatch":true,"sender":{"key":"schwab@linux-m68k.org","avatar":"https://avatars.githubusercontent.com/u/2175493?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> Andreas Schwab <schwab@linux-m68k.org> writes:\n>\n>> This configuration variable sets the default for the --full-name option.\n>>\n>> Signed-off-by: Andreas Schwab <schwab@linux-m68k.org>\n>> ---\n>\n> Would this change break Porcelains (e.g. Emacs modes) and force them\n> to be updated to explicitly pass --no-full-name to unbreak them?\n\nYes, that would be required.  On the other hand, currently it is\nimpossible to cut-n-paste a file name without --full-name, since the\npager is always started in top-level.  Perhaps it is better to fix the\nlatter?\n\nAndreas.\n\n-- \nAndreas Schwab, schwab@linux-m68k.org\nGPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5\n\"And now for something completely different.\"\n"},{"id":"236995","messageId":"xmqqzjkn8i78.fsf@gitster.dls.corp.google.com","threadId":"36200","inReplyTo":"mvmy507stf1.fsf@hawking.suse.de","subject":"Re: [PATCH] Add grep.fullName config variable","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-03-18T18:39:23Z","receivedAt":"2014-03-18T18:39:23Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Andreas Schwab <schwab@linux-m68k.org> writes:\n\n> Yes, that would be required.  On the other hand, currently it is\n> impossible to cut-n-paste a file name without --full-name, since the\n> pager is always started in top-level.  Perhaps it is better to fix the\n> latter?\n\nSo far we never cared where the pager runs, but as a principle, I\nthink it would be nice if we run it in the original subdirectory,\nnot at the top of the working tree (unless we have to bend backwards\nto make the codepath involved too ugly, that is).\n\nDon't we have the exact same issue for the editor, by the way?\nShouldn't we be running it in the original subdirectory as well?\n"},{"id":"237005","messageId":"87d2hj9tfg.fsf@igel.home","threadId":"36200","inReplyTo":"xmqqzjkn8i78.fsf@gitster.dls.corp.google.com","subject":"Re: [PATCH] Add grep.fullName config variable","fromName":"Andreas Schwab","fromEmail":"schwab@linux-m68k.org","sentAt":"2014-03-18T19:51:31Z","receivedAt":"2014-03-18T19:51:31Z","isPatch":true,"sender":{"key":"schwab@linux-m68k.org","avatar":"https://avatars.githubusercontent.com/u/2175493?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> Don't we have the exact same issue for the editor, by the way?\n> Shouldn't we be running it in the original subdirectory as well?\n\nIt's called with an absolute name, so it shouldn't care.\n\nAndreas.\n\n-- \nAndreas Schwab, schwab@linux-m68k.org\nGPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5\n\"And now for something completely different.\"\n"},{"id":"237007","messageId":"878us79syc.fsf@igel.home","threadId":"36200","inReplyTo":"mvmy507stf1.fsf@hawking.suse.de","subject":"Re: [PATCH] Add grep.fullName config variable","fromName":"Andreas Schwab","fromEmail":"schwab@linux-m68k.org","sentAt":"2014-03-18T20:01:47Z","receivedAt":"2014-03-18T20:01:47Z","isPatch":true,"sender":{"key":"schwab@linux-m68k.org","avatar":"https://avatars.githubusercontent.com/u/2175493?v=4"},"body":"Andreas Schwab <schwab@linux-m68k.org> writes:\n\n> Junio C Hamano <gitster@pobox.com> writes:\n>\n>> Andreas Schwab <schwab@linux-m68k.org> writes:\n>>\n>>> This configuration variable sets the default for the --full-name option.\n>>>\n>>> Signed-off-by: Andreas Schwab <schwab@linux-m68k.org>\n>>> ---\n>>\n>> Would this change break Porcelains (e.g. Emacs modes) and force them\n>> to be updated to explicitly pass --no-full-name to unbreak them?\n>\n> Yes, that would be required.  On the other hand, currently it is\n> impossible to cut-n-paste a file name without --full-name, since the\n> pager is always started in top-level.  Perhaps it is better to fix the\n> latter?\n\nOn the third hand, git grep isn't plumbing, so variation of output is to\nbe expected?  We already have grep.lineNumber and grep.patternType /\ngrep.extendedRegexp (vc-git-grep uses -n itself, but does not protect\nagainst grep.patternType).\n\nAndreas.\n\n-- \nAndreas Schwab, schwab@linux-m68k.org\nGPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5\n\"And now for something completely different.\"\n"},{"id":"237010","messageId":"xmqqmwgn6z4s.fsf@gitster.dls.corp.google.com","threadId":"36200","inReplyTo":"87d2hj9tfg.fsf@igel.home","subject":"Re: [PATCH] Add grep.fullName config variable","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-03-18T20:16:35Z","receivedAt":"2014-03-18T20:16:35Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Andreas Schwab <schwab@linux-m68k.org> writes:\n\n> Junio C Hamano <gitster@pobox.com> writes:\n>\n>> Don't we have the exact same issue for the editor, by the way?\n>> Shouldn't we be running it in the original subdirectory as well?\n>\n> It's called with an absolute name, so it shouldn't care.\n\nBut we should not have to call with absolute paths when a short and\nsweet pathname relative to the user's current directory. That is the\nprimary point of my comment.\n"}]}