{"thread":{"id":"31867","subject":"[PATCH 0/2] gitk: fix --full-diff handling","startedAt":"2012-10-19T10:56:51Z","lastAt":"2012-10-19T13:22:36Z","messageCount":5,"participants":["Felipe Contreras","Johannes Sixt"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"201549","messageId":"1350644213-4882-1-git-send-email-felipe.contreras@gmail.com","threadId":"31867","inReplyTo":null,"subject":"[PATCH 0/2] gitk: fix --full-diff handling","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2012-10-19T10:56:51Z","receivedAt":"2012-10-19T10:56:51Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"Hi,\n\nI find usel to do 'git log --full-duff -- file' to find out all the commits\nthat touched the file, and show the full diff (not just the one of the file).\n\nUnfortunately gitk doesn't honour this option; the diff is limited in the UI.\n\nThe following patches fix that.\n\nFelipe Contreras (2):\n  gitk: simplify file filtering\n  gitk: handle --full-diff correctly\n\n gitk-git/gitk | 33 +++++++++++++++++----------------\n 1 file changed, 17 insertions(+), 16 deletions(-)\n\n-- \n1.8.0.rc2.7.g0961fdf.dirty\n"},{"id":"201550","messageId":"1350644213-4882-2-git-send-email-felipe.contreras@gmail.com","threadId":"31867","inReplyTo":"1350644213-4882-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH 1/2] gitk: simplify file filtering","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2012-10-19T10:56:52Z","receivedAt":"2012-10-19T10:56:52Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"git diff is perfectly able to do this with '-- files', no need for\nmanual filtering.\n\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n gitk-git/gitk | 20 +++++++-------------\n 1 file changed, 7 insertions(+), 13 deletions(-)\n\ndiff --git a/gitk-git/gitk b/gitk-git/gitk\nindex d93bd99..b79dfdf 100755\n--- a/gitk-git/gitk\n+++ b/gitk-git/gitk\n@@ -7519,9 +7519,13 @@ proc diffcmd {ids flags} {\n }\n \n proc gettreediffs {ids} {\n-    global treediff treepending\n+    global treediff treepending limitdiffs vfilelimit curview\n \n-    if {[catch {set gdtf [open [diffcmd $ids {--no-commit-id}] r]}]} return\n+    set cmd [diffcmd $ids {--no-commit-id}]\n+    if {$limitdiffs && $vfilelimit($curview) ne {}} {\n+\t    set cmd [concat $cmd -- $vfilelimit($curview)]\n+    }\n+    if {[catch {set gdtf [open $cmd r]}]} return\n \n     set treepending $ids\n     set treediff {}\n@@ -7565,17 +7569,7 @@ proc gettreediffline {gdtf ids} {\n \treturn [expr {$nr >= $max? 2: 1}]\n     }\n     close $gdtf\n-    if {$limitdiffs && $vfilelimit($curview) ne {}} {\n-\tset flist {}\n-\tforeach f $treediff {\n-\t    if {[path_filter $vfilelimit($curview) $f]} {\n-\t\tlappend flist $f\n-\t    }\n-\t}\n-\tset treediffs($ids) $flist\n-    } else {\n-\tset treediffs($ids) $treediff\n-    }\n+    set treediffs($ids) $treediff\n     unset treepending\n     if {$cmitmode eq \"tree\" && [llength $diffids] == 1} {\n \tgettree $diffids\n-- \n1.8.0.rc2.7.g0961fdf.dirty\n"},{"id":"201551","messageId":"1350644213-4882-3-git-send-email-felipe.contreras@gmail.com","threadId":"31867","inReplyTo":"1350644213-4882-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH 2/2] gitk: handle --full-diff correctly","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2012-10-19T10:56:53Z","receivedAt":"2012-10-19T10:56:53Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"Otherwise the files are missing from the diff, and the list of files.\n\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n gitk-git/gitk | 15 +++++++++++----\n 1 file changed, 11 insertions(+), 4 deletions(-)\n\ndiff --git a/gitk-git/gitk b/gitk-git/gitk\nindex b79dfdf..8109eed 100755\n--- a/gitk-git/gitk\n+++ b/gitk-git/gitk\n@@ -155,7 +155,7 @@ proc unmerged_files {files} {\n }\n \n proc parseviewargs {n arglist} {\n-    global vdatemode vmergeonly vflags vdflags vrevs vfiltered vorigargs env\n+    global vdatemode vmergeonly vflags vdflags vrevs vfiltered vorigargs vfileargs env\n     global worddiff git_version\n \n     set vdatemode($n) 0\n@@ -165,6 +165,7 @@ proc parseviewargs {n arglist} {\n     set nextisval 0\n     set revargs {}\n     set origargs $arglist\n+    set fileargs {}\n     set allknown 1\n     set filtered 0\n     set i -1\n@@ -187,7 +188,7 @@ proc parseviewargs {n arglist} {\n \t    \"--no-renames\" - \"--full-index\" - \"--binary\" - \"--abbrev=*\" -\n \t    \"--find-copies-harder\" - \"-l*\" - \"--ext-diff\" - \"--no-ext-diff\" -\n \t    \"--src-prefix=*\" - \"--dst-prefix=*\" - \"--no-prefix\" -\n-\t    \"-O*\" - \"--text\" - \"--full-diff\" - \"--ignore-space-at-eol\" -\n+\t    \"-O*\" - \"--text\" - \"--ignore-space-at-eol\" -\n \t    \"--ignore-space-change\" - \"-U*\" - \"--unified=*\" {\n \t\t# These request or affect diff output, which we don't want.\n \t\t# Some could be used to set our defaults for diff display.\n@@ -233,6 +234,9 @@ proc parseviewargs {n arglist} {\n \t\tset filtered 1\n \t\tlappend glflags $arg\n \t    }\n+\t    \"--full-diff\" {\n+\t\tlappend fileargs $arg\n+\t    }\n \t    \"-n\" {\n \t\t# This appears to be the only one that has a value as a\n \t\t# separate word following it\n@@ -276,6 +280,7 @@ proc parseviewargs {n arglist} {\n     set vrevs($n) $revargs\n     set vfiltered($n) $filtered\n     set vorigargs($n) $origargs\n+    set vfileargs($n) $fileargs\n     return $allknown\n }\n \n@@ -7519,10 +7524,11 @@ proc diffcmd {ids flags} {\n }\n \n proc gettreediffs {ids} {\n-    global treediff treepending limitdiffs vfilelimit curview\n+    global treediff treepending limitdiffs vfilelimit vfileargs curview\n \n     set cmd [diffcmd $ids {--no-commit-id}]\n     if {$limitdiffs && $vfilelimit($curview) ne {}} {\n+\t    set cmd [concat $cmd $vfileargs($curview)]\n \t    set cmd [concat $cmd -- $vfilelimit($curview)]\n     }\n     if {[catch {set gdtf [open $cmd r]}]} return\n@@ -7613,7 +7619,7 @@ proc getblobdiffs {ids} {\n     global diffcontext\n     global ignorespace\n     global worddiff\n-    global limitdiffs vfilelimit curview\n+    global limitdiffs vfilelimit vfileargs curview\n     global diffencoding targetline diffnparents\n     global git_version currdiffsubmod\n \n@@ -7633,6 +7639,7 @@ proc getblobdiffs {ids} {\n \tappend cmd \" --word-diff=porcelain\"\n     }\n     if {$limitdiffs && $vfilelimit($curview) ne {}} {\n+\tset cmd [concat $cmd $vfileargs($curview)]\n \tset cmd [concat $cmd -- $vfilelimit($curview)]\n     }\n     if {[catch {set bdf [open $cmd r]} err]} {\n-- \n1.8.0.rc2.7.g0961fdf.dirty\n"},{"id":"201552","messageId":"508151A0.3050505@viscovery.net","threadId":"31867","inReplyTo":"1350644213-4882-1-git-send-email-felipe.contreras@gmail.com","subject":"Re: [PATCH 0/2] gitk: fix --full-diff handling","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2012-10-19T13:12:00Z","receivedAt":"2012-10-19T13:12:00Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Am 10/19/2012 12:56, schrieb Felipe Contreras:\n> I find usel to do 'git log --full-duff -- file' to find out all the commits\n> that touched the file, and show the full diff (not just the one of the file).\n> \n> Unfortunately gitk doesn't honour this option; the diff is limited in the UI.\n\nThere is Edit->Preferences->General->Limit diff to listed paths. Doesn't\nit do what you want if you switch it off?\n\n-- Hannes\n"},{"id":"201554","messageId":"CAMP44s1F9eKpSiTQLTjXz4R0NewaMaw3554O=ynvGFXsKYEaaA@mail.gmail.com","threadId":"31867","inReplyTo":"508151A0.3050505@viscovery.net","subject":"Re: [PATCH 0/2] gitk: fix --full-diff handling","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2012-10-19T13:22:36Z","receivedAt":"2012-10-19T13:22:36Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"On Fri, Oct 19, 2012 at 3:12 PM, Johannes Sixt <j.sixt@viscovery.net> wrote:\n> Am 10/19/2012 12:56, schrieb Felipe Contreras:\n>> I find usel to do 'git log --full-duff -- file' to find out all the commits\n>> that touched the file, and show the full diff (not just the one of the file).\n>>\n>> Unfortunately gitk doesn't honour this option; the diff is limited in the UI.\n>\n> There is Edit->Preferences->General->Limit diff to listed paths. Doesn't\n> it do what you want if you switch it off?\n\nHmm, I guess so, but it's not triggered from the command line. Maybe\nthe --full-diff option should enable that flag.\n\n-- \nFelipe Contreras\n"}]}