{"thread":{"id":"40197","subject":"[PATCH v2] stash: Add stash.showFlag config variable","startedAt":"2015-08-27T15:49:13Z","lastAt":"2015-08-27T15:55:37Z","messageCount":2,"participants":["Namhyung Kim"],"isPatch":true,"patchVersion":2,"patchTotal":null},"messages":[{"id":"268797","messageId":"1440690553-28582-1-git-send-email-namhyung@gmail.com","threadId":"40197","inReplyTo":null,"subject":"[PATCH v2] stash: Add stash.showFlag config variable","fromName":"Namhyung Kim","fromEmail":"namhyung@gmail.com","sentAt":"2015-08-27T15:49:13Z","receivedAt":"2015-08-27T15:49:13Z","isPatch":true,"sender":{"key":"namhyung@gmail.com","avatar":"https://avatars.githubusercontent.com/u/48503?v=4"},"body":"Some users might want to see diff (patch) output always rather than\ndiffstat when [s]he runs 'git stash show'.  Although this can be done\nwith adding -p option, it'd be better to provide a config option to\ncontrol this behavior IMHO.\n\nSigned-off-by: Namhyung Kim <namhyung@gmail.com>\n---\n Documentation/config.txt    | 5 +++++\n Documentation/git-stash.txt | 1 +\n git-stash.sh                | 7 ++++++-\n 3 files changed, 12 insertions(+), 1 deletion(-)\n\ndiff --git a/Documentation/config.txt b/Documentation/config.txt\nindex f5d15ff..bbadae6 100644\n--- a/Documentation/config.txt\n+++ b/Documentation/config.txt\n@@ -2567,6 +2567,11 @@ status.submoduleSummary::\n \tsubmodule summary' command, which shows a similar output but does\n \tnot honor these settings.\n \n+stash.showFlag::\n+\tThe default option to pass to `git stash show` when no option is\n+\tgiven. The default is '--stat'.  See description of 'show' command\n+\tin linkgit:git-stash[1].\n+\n submodule.<name>.path::\n submodule.<name>.url::\n \tThe path within this project and URL for a submodule. These\ndiff --git a/Documentation/git-stash.txt b/Documentation/git-stash.txt\nindex 375213f..e00f67e 100644\n--- a/Documentation/git-stash.txt\n+++ b/Documentation/git-stash.txt\n@@ -95,6 +95,7 @@ show [<stash>]::\n \tshows the latest one. By default, the command shows the diffstat, but\n \tit will accept any format known to 'git diff' (e.g., `git stash show\n \t-p stash@{1}` to view the second most recent stash in patch form).\n+\tYou can use stash.showflag config variable to change this behavior.\n \n pop [--index] [-q|--quiet] [<stash>]::\n \ndiff --git a/git-stash.sh b/git-stash.sh\nindex 1d5ba7a..f48a97d 100755\n--- a/git-stash.sh\n+++ b/git-stash.sh\n@@ -305,7 +305,12 @@ show_stash () {\n \tALLOW_UNKNOWN_FLAGS=t\n \tassert_stash_like \"$@\"\n \n-\tgit diff ${FLAGS:---stat} $b_commit $w_commit\n+\tif test -z \"$FLAGS\"\n+\tthen\n+\t\tshow_flag=$(git config --get stash.showFlag || echo \"--stat\")\n+\tfi\n+\n+\tgit diff ${FLAGS:-${show_flag}} $b_commit $w_commit\n }\n \n show_help () {\n-- \n2.5.0\n"},{"id":"268798","messageId":"1440690937-11424-1-git-send-email-namhyung@gmail.com","threadId":"40197","inReplyTo":"1440690553-28582-1-git-send-email-namhyung@gmail.com","subject":"[PATCH v2.1] stash: Add stash.showFlag config variable","fromName":"Namhyung Kim","fromEmail":"namhyung@gmail.com","sentAt":"2015-08-27T15:55:37Z","receivedAt":"2015-08-27T15:55:37Z","isPatch":true,"sender":{"key":"namhyung@gmail.com","avatar":"https://avatars.githubusercontent.com/u/48503?v=4"},"body":"Some users might want to see diff (patch) output always rather than\ndiffstat when [s]he runs 'git stash show'.  Although this can be done\nwith adding -p option, it'd be better to provide a config option to\ncontrol this behavior IMHO.\n\nSigned-off-by: Namhyung Kim <namhyung@gmail.com>\n---\n Documentation/config.txt    | 5 +++++\n Documentation/git-stash.txt | 1 +\n git-stash.sh                | 7 ++++++-\n 3 files changed, 12 insertions(+), 1 deletion(-)\n\ndiff --git a/Documentation/config.txt b/Documentation/config.txt\nindex f5d15ff..bbadae6 100644\n--- a/Documentation/config.txt\n+++ b/Documentation/config.txt\n@@ -2567,6 +2567,11 @@ status.submoduleSummary::\n \tsubmodule summary' command, which shows a similar output but does\n \tnot honor these settings.\n \n+stash.showFlag::\n+\tThe default option to pass to `git stash show` when no option is\n+\tgiven. The default is '--stat'.  See description of 'show' command\n+\tin linkgit:git-stash[1].\n+\n submodule.<name>.path::\n submodule.<name>.url::\n \tThe path within this project and URL for a submodule. These\ndiff --git a/Documentation/git-stash.txt b/Documentation/git-stash.txt\nindex 375213f..e00f67e 100644\n--- a/Documentation/git-stash.txt\n+++ b/Documentation/git-stash.txt\n@@ -95,6 +95,7 @@ show [<stash>]::\n \tshows the latest one. By default, the command shows the diffstat, but\n \tit will accept any format known to 'git diff' (e.g., `git stash show\n \t-p stash@{1}` to view the second most recent stash in patch form).\n+\tYou can use stash.showflag config variable to change this behavior.\n \n pop [--index] [-q|--quiet] [<stash>]::\n \ndiff --git a/git-stash.sh b/git-stash.sh\nindex 1d5ba7a..992fb02 100755\n--- a/git-stash.sh\n+++ b/git-stash.sh\n@@ -305,7 +305,12 @@ show_stash () {\n \tALLOW_UNKNOWN_FLAGS=t\n \tassert_stash_like \"$@\"\n \n-\tgit diff ${FLAGS:---stat} $b_commit $w_commit\n+\tif test -z \"$FLAGS\"\n+\tthen\n+\t\tFLAGS=$(git config --get stash.showFlag || echo \"--stat\")\n+\tfi\n+\n+\tgit diff ${FLAGS} $b_commit $w_commit\n }\n \n show_help () {\n-- \n2.5.0\n"}]}