{"thread":{"id":"49068","subject":"[PATCH] status: -i shorthand for --ignored command line option","startedAt":"2018-08-08T06:48:12Z","lastAt":"2018-08-13T16:46:29Z","messageCount":6,"participants":["Nicholas Guriev","Eric Sunshine","Junio C Hamano","Коля Гурьев"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"354786","messageId":"20180808063926.11911-1-guriev-ns@ya.ru","threadId":"49068","inReplyTo":"20180804181539.29536-1-guriev-ns@ya.ru","subject":"[PATCH] status: -i shorthand for --ignored command line option","fromName":"Nicholas Guriev","fromEmail":"guriev-ns@ya.ru","sentAt":"2018-08-08T06:39:26Z","receivedAt":"2018-08-08T06:48:12Z","isPatch":true,"sender":{"key":"guriev-ns@ya.ru","avatar":"https://avatars.githubusercontent.com/u/9163157?v=4"},"body":"This short option saves the number of keys to press for the\ntypically git-status command.\n---\nI already sent the patch here, but it doesn't seem reached to the\nlist. So I send the email (now with DKIM) again and apologize if you\nget this twice.\n\n builtin/commit.c | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/builtin/commit.c b/builtin/commit.c\nindex 158e3f8..44829b9 100644\n--- a/builtin/commit.c\n+++ b/builtin/commit.c\n@@ -1319,7 +1319,7 @@ int cmd_status(int argc, const char **argv, const char *prefix)\n \t\t  N_(\"mode\"),\n \t\t  N_(\"show untracked files, optional modes: all, normal, no. (Default: all)\"),\n \t\t  PARSE_OPT_OPTARG, NULL, (intptr_t)\"all\" },\n-\t\t{ OPTION_STRING, 0, \"ignored\", &ignored_arg,\n+\t\t{ OPTION_STRING, 'i', \"ignored\", &ignored_arg,\n \t\t  N_(\"mode\"),\n \t\t  N_(\"show ignored files, optional modes: traditional, matching, no. (Default: traditional)\"),\n \t\t  PARSE_OPT_OPTARG, NULL, (intptr_t)\"traditional\" },\n-- \n2.7.4\n\n"},{"id":"354787","messageId":"CAPig+cTD7XYbaPBzj36Eudrud80r-cz1CPLDsLA9CHJC6Yc-Qw@mail.gmail.com","threadId":"49068","inReplyTo":"20180808063926.11911-1-guriev-ns@ya.ru","subject":"Re: [PATCH] status: -i shorthand for --ignored command line option","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2018-08-08T07:34:41Z","receivedAt":"2018-08-08T07:34:55Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"Thanks for the submission. A few comments below...\n\nOn Wed, Aug 8, 2018 at 2:48 AM Nicholas Guriev <guriev-ns@ya.ru> wrote:\n> This short option saves the number of keys to press for the\n> typically git-status command.\n> ---\n\nYour sign-off is missing. See Documentation/SubmittingPatches.\n\nIt's clear that a short name would be helpful to you, but you may need\nto work harder to convince others that it makes sense to squat an a\nshort option name like 'i'. One argument you might use in the commit\nmessage in support of adding a short name to --ignored is that the\nrelated option --untracked-files already has a short name (-u).\n\n>  builtin/commit.c | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n\nThis patch neglects to update the documentation for git-status in\nDocumentation/git-status.txt. It will need to do so if this change is\never to be accepted.\n"},{"id":"354968","messageId":"20180809062142.15638-1-guriev-ns@ya.ru","threadId":"49068","inReplyTo":"CAPig+cTD7XYbaPBzj36Eudrud80r-cz1CPLDsLA9CHJC6Yc-Qw@mail.gmail.com","subject":"[PATCH v2] status: -i shorthand for --ignored command line option","fromName":"Nicholas Guriev","fromEmail":"guriev-ns@ya.ru","sentAt":"2018-08-09T06:21:42Z","receivedAt":"2018-08-09T06:33:53Z","isPatch":true,"sender":{"key":"guriev-ns@ya.ru","avatar":"https://avatars.githubusercontent.com/u/9163157?v=4"},"body":"It allows for uniformity with the --untracked-files option. Also\nthe new short flag saves the number of keys to press for the\ntypically git-status command.\n\nSigned-off-by: Nicholas Guriev <guriev-ns@ya.ru>\n---\n Documentation/git-status.txt | 1 +\n builtin/commit.c             | 2 +-\n 2 files changed, 2 insertions(+), 1 deletion(-)\n\ndiff --git a/Documentation/git-status.txt b/Documentation/git-status.txt\nindex d9f422d..cce352a 100644\n--- a/Documentation/git-status.txt\n+++ b/Documentation/git-status.txt\n@@ -97,6 +97,7 @@ configuration variable documented in linkgit:git-config[1].\n \t(and suppresses the output of submodule summaries when the config option\n \t`status.submoduleSummary` is set).\n \n+-i[<mode>]::\n --ignored[=<mode>]::\n \tShow ignored files as well.\n +\ndiff --git a/builtin/commit.c b/builtin/commit.c\nindex 158e3f8..44829b9 100644\n--- a/builtin/commit.c\n+++ b/builtin/commit.c\n@@ -1319,7 +1319,7 @@ int cmd_status(int argc, const char **argv, const char *prefix)\n \t\t  N_(\"mode\"),\n \t\t  N_(\"show untracked files, optional modes: all, normal, no. (Default: all)\"),\n \t\t  PARSE_OPT_OPTARG, NULL, (intptr_t)\"all\" },\n-\t\t{ OPTION_STRING, 0, \"ignored\", &ignored_arg,\n+\t\t{ OPTION_STRING, 'i', \"ignored\", &ignored_arg,\n \t\t  N_(\"mode\"),\n \t\t  N_(\"show ignored files, optional modes: traditional, matching, no. (Default: traditional)\"),\n \t\t  PARSE_OPT_OPTARG, NULL, (intptr_t)\"traditional\" },\n-- \n2.7.4\n\n"},{"id":"354997","messageId":"xmqqpnyrczo8.fsf@gitster-ct.c.googlers.com","threadId":"49068","inReplyTo":"20180809062142.15638-1-guriev-ns@ya.ru","subject":"Re: [PATCH v2] status: -i shorthand for --ignored command line option","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2018-08-09T15:44:39Z","receivedAt":"2018-08-09T15:44:43Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Nicholas Guriev <guriev-ns@ya.ru> writes:\n\n> It allows for uniformity with the --untracked-files option. Also\n> the new short flag saves the number of keys to press for the\n> typically git-status command.\n\nUnlike \"-u', \"-i\" is supported by \"git commit\" which shares the\nunderlying implementation, and that is the historical reason why we\nnever had \"-i\" shorthand, I think.  \n\nWhile I do understand why sometimes \"-u\" is useful, especially\n\"-uno\", to help those whose .gitignore is not managed as well as it\nshould be, I am not sure why a \"typical git-status\" invocation would\nask for \"--ignored\" that often to require such a short-hand.\n"},{"id":"355305","messageId":"a178d91c-74dd-e04a-8db3-70cd75ad6793@ya.ru","threadId":"49068","inReplyTo":"xmqqpnyrczo8.fsf@gitster-ct.c.googlers.com","subject":"[PATCH v2] status: -i shorthand for --ignored command line option","fromName":"Коля Гурьев","fromEmail":"guriev-ns@ya.ru","sentAt":"2018-08-13T05:02:47Z","receivedAt":"2018-08-13T05:02:53Z","isPatch":true,"sender":{"key":"guriev-ns@ya.ru","avatar":"https://avatars.githubusercontent.com/u/9163157?v=4"},"body":"09.08.2018 18:44, Junio C Hamano пишет:\n> Unlike \"-u', \"-i\" is supported by \"git commit\" which shares the\n> underlying implementation, and that is the historical reason why we\n> never had \"-i\" shorthand, I think.  \n\ngit-commit supports the -u flag, its meaning is the same as for\ngit-status. Although the -i flag might be confused with the --include\noption of git-commit, I suggest this shortening based on first letter of\nthe --ignored option because git-status and git-commit are different\ncommands and it's more obvious shortening.\n\n> While I do understand why sometimes \"-u\" is useful, especially\n> \"-uno\", to help those whose .gitignore is not managed as well as it\n> should be, I am not sure why a \"typical git-status\" invocation would\n> ask for \"--ignored\" that often to require such a short-hand.\n\nThe --ignored option is often used for opposing purposes, to show all\nchanges in working directory regardless of .gitignore files which may be\nwritten sloppy. I've discovered that I type this option quite\nfrequently, and I hope my case may help others.\n\n\n\n"},{"id":"355398","messageId":"xmqqftzi6wps.fsf@gitster-ct.c.googlers.com","threadId":"49068","inReplyTo":"a178d91c-74dd-e04a-8db3-70cd75ad6793@ya.ru","subject":"Re: [PATCH v2] status: -i shorthand for --ignored command line option","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2018-08-13T16:46:23Z","receivedAt":"2018-08-13T16:46:29Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Коля Гурьев <guriev-ns@ya.ru> writes:\n\n> 09.08.2018 18:44, Junio C Hamano пишет:\n>> Unlike \"-u', \"-i\" is supported by \"git commit\" which shares the\n>> underlying implementation, and that is the historical reason why we\n>> never had \"-i\" shorthand, I think.  \n>\n> git-commit supports the -u flag, its meaning is the same as for\n> git-status. Although the -i flag might be confused with the --include\n> option of git-commit,...\n\nYes, I was describing a historical perspective on the reason why\n\"-u\" was there but \"-i\" was not.  Since it is merely historical that\n'status' was a mere synonym to 'commit --dry-run', which no longer\nis the case, that no longer is a reason not to have \"status -i\".\n\nThat is why the paragraph you are responding to in my message\nexists.\n\n>> While I do understand why sometimes \"-u\" is useful, especially\n>> \"-uno\", to help those whose .gitignore is not managed as well as it\n>> should be, I am not sure why a \"typical git-status\" invocation would\n>> ask for \"--ignored\" that often to require such a short-hand.\n>\n> The --ignored option is often used for opposing purposes, to show all\n> changes in working directory regardless of .gitignore files which may be\n> written sloppy.\n\nThat's not \"sloppy\" but \"too tightly\", I think, and you won't get\n\"changes\" to them (only the presence of them).\n\nI know a user can view more paths with \"git status --ignored\" in the\noutput than without the option, and it may sometimes be interesting\n(after all, that is why we have the option in the first place), but\nI am trying to find out why a user needs to constantly asking for\n\"--ignored\" (otherwise there is no point adding a short-and-sweet\n\"-i\").\n\n\"git status -u\" is not by itself a useful tool to \"hide\" the\nsloppyness of the .gitignore patterns, as \"git status\" by default\nacts the same as \"git status -unormal\" does to remind you that you\nforgot to list a pattern to catch build artifacts, and the user who\nwants to stay sloppy needs to work on it by saying something like\n\"git status -uno\".  The short-hand does not encourage people to be\nsloppy too much.  I am hesitant to add a short-hand that is too\nconvenient and encourages people being sloppy (or leaving a too\ntight list of exclude patterns and not fixing) and wondering if \"git\nstatus -i\" alone, without forcing users to type a bit more (like\n\"-uno\" as opposed to \"-u\" alone), is such a short-hand that helps\nundisciplined use of the tool.  That is why I am asking why a\n\"typical git-status\" invocation ask for \"--ignored\" that often to\nrequire such a short-hand.\n"}]}