{"thread":{"id":"26316","subject":"[PATCH] git-gui: add config value gui.diffopts for passing additional diff options","startedAt":"2011-01-21T10:59:45Z","lastAt":"2011-01-28T07:29:02Z","messageCount":4,"participants":["Tilman Vogel","Pat Thoyts","Johannes Sixt"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"159743","messageId":"1295607585-15971-1-git-send-email-tilman.vogel@web.de","threadId":"26316","inReplyTo":null,"subject":"[PATCH] git-gui: add config value gui.diffopts for passing additional diff options","fromName":"Tilman Vogel","fromEmail":"tilman.vogel@web.de","sentAt":"2011-01-21T10:59:45Z","receivedAt":"2011-01-21T10:59:45Z","isPatch":true,"sender":{"key":"tilman.vogel@web.de","avatar":"https://avatars.githubusercontent.com/u/349303?v=4"},"body":"Signed-off-by: Tilman Vogel <tilman.vogel@web.de>\n---\n Documentation/config.txt |    4 ++++\n git-gui/git-gui.sh       |    1 +\n git-gui/lib/diff.tcl     |    1 +\n git-gui/lib/option.tcl   |    1 +\n 4 files changed, 7 insertions(+), 0 deletions(-)\n\ndiff --git a/Documentation/config.txt b/Documentation/config.txt\nindex ff7c225..0ed7bcf 100644\n--- a/Documentation/config.txt\n+++ b/Documentation/config.txt\n@@ -1100,6 +1100,10 @@ gui.diffcontext::\n \tSpecifies how many context lines should be used in calls to diff\n \tmade by the linkgit:git-gui[1]. The default is \"5\".\n \n+gui.diffopts::\n+\tSpecifies additional parameters to pass to diff from \n+\tlinkgit:git-gui[1]. The default is \"\".\n+\n gui.encoding::\n \tSpecifies the default encoding to use for displaying of\n \tfile contents in linkgit:git-gui[1] and linkgit:gitk[1].\ndiff --git a/git-gui/git-gui.sh b/git-gui/git-gui.sh\nindex d3acf0d..2a3aed5 100755\n--- a/git-gui/git-gui.sh\n+++ b/git-gui/git-gui.sh\n@@ -823,6 +823,7 @@ set default_config(gui.fastcopyblame) false\n set default_config(gui.copyblamethreshold) 40\n set default_config(gui.blamehistoryctx) 7\n set default_config(gui.diffcontext) 5\n+set default_config(gui.diffopts) {}\n set default_config(gui.commitmsgwidth) 75\n set default_config(gui.newbranchtemplate) {}\n set default_config(gui.spellingdictionary) {}\ndiff --git a/git-gui/lib/diff.tcl b/git-gui/lib/diff.tcl\nindex dcf0711..de3827a 100644\n--- a/git-gui/lib/diff.tcl\n+++ b/git-gui/lib/diff.tcl\n@@ -295,6 +295,7 @@ proc start_show_diff {cont_info {add_opts {}}} {\n \n \tlappend cmd -p\n \tlappend cmd --color\n+\tset cmd [concat $cmd $repo_config(gui.diffopts)]\n \tif {$repo_config(gui.diffcontext) >= 1} {\n \t\tlappend cmd \"-U$repo_config(gui.diffcontext)\"\n \t}\ndiff --git a/git-gui/lib/option.tcl b/git-gui/lib/option.tcl\nindex 3807c8d..1e5d28c 100644\n--- a/git-gui/lib/option.tcl\n+++ b/git-gui/lib/option.tcl\n@@ -153,6 +153,7 @@ proc do_options {} {\n \t\t{i-20..200 gui.copyblamethreshold {mc \"Minimum Letters To Blame Copy On\"}}\n \t\t{i-0..300 gui.blamehistoryctx {mc \"Blame History Context Radius (days)\"}}\n \t\t{i-1..99 gui.diffcontext {mc \"Number of Diff Context Lines\"}}\n+\t\t{t gui.diffopts {mc \"Additional Diff Parameters\"}}\n \t\t{i-0..99 gui.commitmsgwidth {mc \"Commit Message Text Width\"}}\n \t\t{t gui.newbranchtemplate {mc \"New Branch Name Template\"}}\n \t\t{c gui.encoding {mc \"Default File Contents Encoding\"}}\n-- \n1.7.3.4\n"},{"id":"159837","messageId":"87ipxdn81f.fsf@fox.patthoyts.tk","threadId":"26316","inReplyTo":"1295607585-15971-1-git-send-email-tilman.vogel@web.de","subject":"Re: [PATCH] git-gui: add config value gui.diffopts for passing additional diff options","fromName":"Pat Thoyts","fromEmail":"patthoyts@users.sourceforge.net","sentAt":"2011-01-25T00:25:48Z","receivedAt":"2011-01-25T00:25:48Z","isPatch":true,"sender":{"key":"patthoyts@users.sourceforge.net","avatar":"https://avatars.githubusercontent.com/u/30739?v=4"},"body":"Tilman Vogel <tilman.vogel@web.de> writes:\n\n>Signed-off-by: Tilman Vogel <tilman.vogel@web.de>\n>---\n> Documentation/config.txt |    4 ++++\n> git-gui/git-gui.sh       |    1 +\n> git-gui/lib/diff.tcl     |    1 +\n> git-gui/lib/option.tcl   |    1 +\n> 4 files changed, 7 insertions(+), 0 deletions(-)\n>\n>diff --git a/Documentation/config.txt b/Documentation/config.txt\n>index ff7c225..0ed7bcf 100644\n>--- a/Documentation/config.txt\n>+++ b/Documentation/config.txt\n>@@ -1100,6 +1100,10 @@ gui.diffcontext::\n> \tSpecifies how many context lines should be used in calls to diff\n> \tmade by the linkgit:git-gui[1]. The default is \"5\".\n> \n>+gui.diffopts::\n>+\tSpecifies additional parameters to pass to diff from \n>+\tlinkgit:git-gui[1]. The default is \"\".\n>+\n> gui.encoding::\n> \tSpecifies the default encoding to use for displaying of\n> \tfile contents in linkgit:git-gui[1] and linkgit:gitk[1].\n>diff --git a/git-gui/git-gui.sh b/git-gui/git-gui.sh\n>index d3acf0d..2a3aed5 100755\n>--- a/git-gui/git-gui.sh\n>+++ b/git-gui/git-gui.sh\n>@@ -823,6 +823,7 @@ set default_config(gui.fastcopyblame) false\n> set default_config(gui.copyblamethreshold) 40\n> set default_config(gui.blamehistoryctx) 7\n> set default_config(gui.diffcontext) 5\n>+set default_config(gui.diffopts) {}\n> set default_config(gui.commitmsgwidth) 75\n> set default_config(gui.newbranchtemplate) {}\n> set default_config(gui.spellingdictionary) {}\n>diff --git a/git-gui/lib/diff.tcl b/git-gui/lib/diff.tcl\n>index dcf0711..de3827a 100644\n>--- a/git-gui/lib/diff.tcl\n>+++ b/git-gui/lib/diff.tcl\n>@@ -295,6 +295,7 @@ proc start_show_diff {cont_info {add_opts {}}} {\n> \n> \tlappend cmd -p\n> \tlappend cmd --color\n>+\tset cmd [concat $cmd $repo_config(gui.diffopts)]\n> \tif {$repo_config(gui.diffcontext) >= 1} {\n> \t\tlappend cmd \"-U$repo_config(gui.diffcontext)\"\n> \t}\n>diff --git a/git-gui/lib/option.tcl b/git-gui/lib/option.tcl\n>index 3807c8d..1e5d28c 100644\n>--- a/git-gui/lib/option.tcl\n>+++ b/git-gui/lib/option.tcl\n>@@ -153,6 +153,7 @@ proc do_options {} {\n> \t\t{i-20..200 gui.copyblamethreshold {mc \"Minimum Letters To Blame Copy On\"}}\n> \t\t{i-0..300 gui.blamehistoryctx {mc \"Blame History Context Radius (days)\"}}\n> \t\t{i-1..99 gui.diffcontext {mc \"Number of Diff Context Lines\"}}\n>+\t\t{t gui.diffopts {mc \"Additional Diff Parameters\"}}\n> \t\t{i-0..99 gui.commitmsgwidth {mc \"Commit Message Text Width\"}}\n> \t\t{t gui.newbranchtemplate {mc \"New Branch Name Template\"}}\n> \t\t{c gui.encoding {mc \"Default File Contents Encoding\"}}\n\nThis seems ok but you don't say what it is for. Why do you want to be\nable to pass additional options to git diff?\n\nI can apply this to git-gui's repository. The Documentation change will\nneed to be sent to git separately once this is merged from git-gui.\n\n-- \nPat Thoyts                            http://www.patthoyts.tk/\nPGP fingerprint 2C 6E 98 07 2C 59 C8 97  10 CE 11 E6 04 E0 B9 DD\n"},{"id":"159966","messageId":"4D420B95.2060509@web.de","threadId":"26316","inReplyTo":"87ipxdn81f.fsf@fox.patthoyts.tk","subject":"Re: [PATCH] git-gui: add config value gui.diffopts for passing additional diff options","fromName":"Tilman Vogel","fromEmail":"tilman.vogel@web.de","sentAt":"2011-01-28T00:19:33Z","receivedAt":"2011-01-28T00:19:33Z","isPatch":true,"sender":{"key":"tilman.vogel@web.de","avatar":"https://avatars.githubusercontent.com/u/349303?v=4"},"body":"-----BEGIN PGP SIGNED MESSAGE-----\nHash: SHA1\n\nHi!\n\nAm 25.01.2011 01:25, schrieb Pat Thoyts:\n> This seems ok but you don't say what it is for. Why do you want to be\n> able to pass additional options to git diff?\n\nSorry, forgot to copy the motivation from\n<https://github.com/git/git/pull/8>:\n\nI want to be able to make diff ignore whitespace changes \"-b\". But maybe\nsomeone else wants \"-w\" or what not, so I think a generic option field\nis most versatile.\n\nIf you feel, this switch should be easier to reach than through the\noptions menu, I agree, but I am a Tcl/Tk newbie, so this was the easiest\nfix for me.\n\n> I can apply this to git-gui's repository. The Documentation change will\n> need to be sent to git separately once this is merged from git-gui.\n\nSure, I would be happy. However, if you feel like coding up something\nthat's easier to use, I'd be even happier. But maybe the generic field\nis still of use.\n\nRegards,\n\nTilman\n\n-----BEGIN PGP SIGNATURE-----\nVersion: GnuPG v2.0.15 (GNU/Linux)\nComment: Using GnuPG with SUSE - http://enigmail.mozdev.org/\n\niEYEARECAAYFAk1CC5UACgkQ9ZPu6Yae8lknCwCfcEfBH8uSSZbB93IHpJiEivll\nzlwAoKgPswZGMf6fERRB8p24TsLCGA1r\n=uWHw\n-----END PGP SIGNATURE-----\n"},{"id":"159967","messageId":"4D42703E.5070202@viscovery.net","threadId":"26316","inReplyTo":"4D420B95.2060509@web.de","subject":"Re: [PATCH] git-gui: add config value gui.diffopts for passing additional diff options","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2011-01-28T07:29:02Z","receivedAt":"2011-01-28T07:29:02Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Am 1/28/2011 1:19, schrieb Tilman Vogel:\n> Am 25.01.2011 01:25, schrieb Pat Thoyts:\n>> This seems ok but you don't say what it is for. Why do you want to be\n>> able to pass additional options to git diff?\n> \n> Sorry, forgot to copy the motivation from\n> <https://github.com/git/git/pull/8>:\n> \n> I want to be able to make diff ignore whitespace changes \"-b\". But maybe\n> someone else wants \"-w\" or what not, so I think a generic option field\n> is most versatile.\n\nWhat do you expect to happen, when a user writes any of the following in\nthat edit box?\n\n  --name-status\n  -R\n  --frotz\n  origin master\n\nDon't you want to diagnose bogus input?\nDisable \"Stage/Unstage hung/lines\" (because they won't apply anymore)?\nEtc.\n\nI don't think this is a great improvement. At the least it is not thought\nthrough.\n\n-- Hannes\n"}]}