* [PATCH] stash: use named constant when parsing "--all"
@ 2026-10-04 10:05 Phillip Wood
2026-10-05 5:27 ` Junio C Hamano
0 siblings, 1 reply; 2+ messages in thread
From: Phillip Wood @ 2026-10-04 10:05 UTC (permalink / raw)
To: git; +Cc: Phillip Wood
From: Phillip Wood <phillip.wood@dunelm.org.uk>
The code that stashes all untracked files compares the value of the
"include_untracked" variable to the constant "INCLUDE_ALL_FILES",
however the option parsing code for "--all" uses a hard coded integer
instead. Replace the integer with the named constant.
Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>
---
base-commit: a018953688f1b10bddf91bff8747068f5f4746a4
Published-As: https://github.com/phillipwood/git/releases/tag/pw%2Fstash-all-untracked-use-named-constant%2Fv1
View-Changes-At: https://github.com/phillipwood/git/compare/a01895368...06b58ae0a
Fetch-It-Via: git fetch https://github.com/phillipwood/git pw/stash-all-untracked-use-named-constant/v1
builtin/stash.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/builtin/stash.c b/builtin/stash.c
index 7a9843413b1..4bdd51cd49f 100644
--- a/builtin/stash.c
+++ b/builtin/stash.c
@@ -1932,7 +1932,7 @@ static int push_stash(int argc, const char **argv, const char *prefix,
OPT_BOOL('u', "include-untracked", &include_untracked,
N_("include untracked files in stash")),
OPT_SET_INT('a', "all", &include_untracked,
- N_("include ignore files"), 2),
+ N_("include ignore files"), INCLUDE_ALL_FILES),
OPT_STRING('m', "message", &stash_msg, N_("message"),
N_("stash message")),
OPT_PATHSPEC_FROM_FILE(&pathspec_from_file),
@@ -2039,7 +2039,7 @@ static int save_stash(int argc, const char **argv, const char *prefix,
OPT_BOOL('u', "include-untracked", &include_untracked,
N_("include untracked files in stash")),
OPT_SET_INT('a', "all", &include_untracked,
- N_("include ignore files"), 2),
+ N_("include ignore files"), INCLUDE_ALL_FILES),
OPT_STRING('m', "message", &stash_msg, "message",
N_("stash message")),
OPT_END()
--
2.56.0.134.g299a3c16181
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] stash: use named constant when parsing "--all"
2026-10-04 10:05 [PATCH] stash: use named constant when parsing "--all" Phillip Wood
@ 2026-10-05 5:27 ` Junio C Hamano
0 siblings, 0 replies; 2+ messages in thread
From: Junio C Hamano @ 2026-10-05 5:27 UTC (permalink / raw)
To: Phillip Wood; +Cc: git
Phillip Wood <phillip.wood123@gmail.com> writes:
> From: Phillip Wood <phillip.wood@dunelm.org.uk>
>
> The code that stashes all untracked files compares the value of the
> "include_untracked" variable to the constant "INCLUDE_ALL_FILES",
> however the option parsing code for "--all" uses a hard coded integer
> instead. Replace the integer with the named constant.
>
> Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>
> ---
> - N_("include ignore files"), 2),
> + N_("include ignore files"), INCLUDE_ALL_FILES),
> - N_("include ignore files"), 2),
> + N_("include ignore files"), INCLUDE_ALL_FILES),
So obviously right. I wish all patches were like this ;-).
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-10-05 5:27 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-04 10:05 [PATCH] stash: use named constant when parsing "--all" Phillip Wood
2026-10-05 5:27 ` Junio C Hamano
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox