{"thread":{"id":"66459","subject":"[PATCH] stash: use named constant when parsing \"--all\"","startedAt":"2026-10-04T10:06:10Z","lastAt":"2026-10-05T05:27:30Z","messageCount":2,"participants":["Phillip Wood","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"554104","messageId":"06b58ae0a1d81f4d1518eadecc3385072a72155a.1791108351.git.phillip.wood@dunelm.org.uk","threadId":"66459","inReplyTo":null,"subject":"[PATCH] stash: use named constant when parsing \"--all\"","fromName":"Phillip Wood","fromEmail":"phillip.wood123@gmail.com","sentAt":"2026-10-04T10:05:52Z","receivedAt":"2026-10-04T10:06:10Z","isPatch":true,"body":"From: Phillip Wood <phillip.wood@dunelm.org.uk>\n\nThe code that stashes all untracked files compares the value of the\n\"include_untracked\" variable to the constant \"INCLUDE_ALL_FILES\",\nhowever the option parsing code for \"--all\" uses a hard coded integer\ninstead. Replace the integer with the named constant.\n\nSigned-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>\n---\nbase-commit: a018953688f1b10bddf91bff8747068f5f4746a4\nPublished-As: https://github.com/phillipwood/git/releases/tag/pw%2Fstash-all-untracked-use-named-constant%2Fv1\nView-Changes-At: https://github.com/phillipwood/git/compare/a01895368...06b58ae0a\nFetch-It-Via: git fetch https://github.com/phillipwood/git pw/stash-all-untracked-use-named-constant/v1\n\n builtin/stash.c | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/builtin/stash.c b/builtin/stash.c\nindex 7a9843413b1..4bdd51cd49f 100644\n--- a/builtin/stash.c\n+++ b/builtin/stash.c\n@@ -1932,7 +1932,7 @@ static int push_stash(int argc, const char **argv, const char *prefix,\n \t\tOPT_BOOL('u', \"include-untracked\", &include_untracked,\n \t\t\t N_(\"include untracked files in stash\")),\n \t\tOPT_SET_INT('a', \"all\", &include_untracked,\n-\t\t\t    N_(\"include ignore files\"), 2),\n+\t\t\t    N_(\"include ignore files\"), INCLUDE_ALL_FILES),\n \t\tOPT_STRING('m', \"message\", &stash_msg, N_(\"message\"),\n \t\t\t   N_(\"stash message\")),\n \t\tOPT_PATHSPEC_FROM_FILE(&pathspec_from_file),\n@@ -2039,7 +2039,7 @@ static int save_stash(int argc, const char **argv, const char *prefix,\n \t\tOPT_BOOL('u', \"include-untracked\", &include_untracked,\n \t\t\t N_(\"include untracked files in stash\")),\n \t\tOPT_SET_INT('a', \"all\", &include_untracked,\n-\t\t\t    N_(\"include ignore files\"), 2),\n+\t\t\t    N_(\"include ignore files\"), INCLUDE_ALL_FILES),\n \t\tOPT_STRING('m', \"message\", &stash_msg, \"message\",\n \t\t\t   N_(\"stash message\")),\n \t\tOPT_END()\n-- \n2.56.0.134.g299a3c16181\n\n"},{"id":"554140","messageId":"xmqqzewsogxs.fsf@gitster.g","threadId":"66459","inReplyTo":"06b58ae0a1d81f4d1518eadecc3385072a72155a.1791108351.git.phillip.wood@dunelm.org.uk","subject":"Re: [PATCH] stash: use named constant when parsing \"--all\"","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2026-10-05T05:27:27Z","receivedAt":"2026-10-05T05:27:30Z","isPatch":true,"body":"Phillip Wood <phillip.wood123@gmail.com> writes:\n\n> From: Phillip Wood <phillip.wood@dunelm.org.uk>\n>\n> The code that stashes all untracked files compares the value of the\n> \"include_untracked\" variable to the constant \"INCLUDE_ALL_FILES\",\n> however the option parsing code for \"--all\" uses a hard coded integer\n> instead. Replace the integer with the named constant.\n>\n> Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>\n> ---\n> -\t\t\t    N_(\"include ignore files\"), 2),\n> +\t\t\t    N_(\"include ignore files\"), INCLUDE_ALL_FILES),\n> -\t\t\t    N_(\"include ignore files\"), 2),\n> +\t\t\t    N_(\"include ignore files\"), INCLUDE_ALL_FILES),\n\nSo obviously right.  I wish all patches were like this ;-).\n"}]}