{"thread":{"id":"31944","subject":"[PATCH 0/2] gitk: handle --full-diff corectly","startedAt":"2012-10-25T17:23:19Z","lastAt":"2012-10-29T06:52:25Z","messageCount":5,"participants":["Felipe Contreras","Johannes Sixt"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"201912","messageId":"1351185801-18543-1-git-send-email-felipe.contreras@gmail.com","threadId":"31944","inReplyTo":null,"subject":"[PATCH 0/2] gitk: handle --full-diff corectly","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2012-10-25T17:23:19Z","receivedAt":"2012-10-25T17:23:19Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"Basically $SUBJECT. See details in the 2nd patch.\n\nFelipe Contreras (2):\n  gitk: simplify file filtering\n  gitk: handle --full-diff correctly\n\n gitk-git/gitk | 36 +++++++++++++++++-------------------\n 1 file changed, 17 insertions(+), 19 deletions(-)\n\n-- \n1.8.0\n"},{"id":"201913","messageId":"1351185801-18543-2-git-send-email-felipe.contreras@gmail.com","threadId":"31944","inReplyTo":"1351185801-18543-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-25T17:23:20Z","receivedAt":"2012-10-25T17:23:20Z","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\n"},{"id":"201914","messageId":"1351185801-18543-3-git-send-email-felipe.contreras@gmail.com","threadId":"31944","inReplyTo":"1351185801-18543-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-25T17:23:21Z","receivedAt":"2012-10-25T17:23:21Z","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\nWe do this by creating a limitdiffs variable specific for the view which\ncan be turned of by using --full-diff.\n\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n gitk-git/gitk | 20 ++++++++++++--------\n 1 file changed, 12 insertions(+), 8 deletions(-)\n\ndiff --git a/gitk-git/gitk b/gitk-git/gitk\nindex b79dfdf..4ffabdf 100755\n--- a/gitk-git/gitk\n+++ b/gitk-git/gitk\n@@ -155,11 +155,12 @@ proc unmerged_files {files} {\n }\n \n proc parseviewargs {n arglist} {\n-    global vdatemode vmergeonly vflags vdflags vrevs vfiltered vorigargs env\n-    global worddiff git_version\n+    global vdatemode vmergeonly vlimitdiffs vflags vdflags vrevs vfiltered vorigargs env\n+    global limitdiffs worddiff git_version\n \n     set vdatemode($n) 0\n     set vmergeonly($n) 0\n+    set vlimitdiffs($n) $limitdiffs\n     set glflags {}\n     set diffargs {}\n     set nextisval 0\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@@ -251,6 +252,9 @@ proc parseviewargs {n arglist} {\n \t    \"--no-replace-objects\" {\n \t\tset env(GIT_NO_REPLACE_OBJECTS) \"1\"\n \t    }\n+\t    \"--full-diff\" {\n+\t\tset vlimitdiffs($n) 0\n+\t    }\n \t    \"-*\" {\n \t\t# Other flag arguments including -<n>\n \t\tif {[string is digit -strict [string range $arg 1 end]]} {\n@@ -7519,10 +7523,10 @@ proc diffcmd {ids flags} {\n }\n \n proc gettreediffs {ids} {\n-    global treediff treepending limitdiffs vfilelimit curview\n+    global treediff treepending vlimitdiffs vfilelimit curview\n \n     set cmd [diffcmd $ids {--no-commit-id}]\n-    if {$limitdiffs && $vfilelimit($curview) ne {}} {\n+    if {$vlimitdiffs($curview) && $vfilelimit($curview) ne {}} {\n \t    set cmd [concat $cmd -- $vfilelimit($curview)]\n     }\n     if {[catch {set gdtf [open $cmd r]}]} return\n@@ -7535,7 +7539,7 @@ proc gettreediffs {ids} {\n \n proc gettreediffline {gdtf ids} {\n     global treediff treediffs treepending diffids diffmergeid\n-    global cmitmode vfilelimit curview limitdiffs perfile_attrs\n+    global cmitmode vfilelimit curview perfile_attrs\n \n     set nr 0\n     set sublist {}\n@@ -7613,7 +7617,7 @@ proc getblobdiffs {ids} {\n     global diffcontext\n     global ignorespace\n     global worddiff\n-    global limitdiffs vfilelimit curview\n+    global vlimitdiffs vfilelimit curview\n     global diffencoding targetline diffnparents\n     global git_version currdiffsubmod\n \n@@ -7632,7 +7636,7 @@ proc getblobdiffs {ids} {\n     if {$worddiff ne [mc \"Line diff\"]} {\n \tappend cmd \" --word-diff=porcelain\"\n     }\n-    if {$limitdiffs && $vfilelimit($curview) ne {}} {\n+    if {$vlimitdiffs($curview) && $vfilelimit($curview) ne {}} {\n \tset cmd [concat $cmd -- $vfilelimit($curview)]\n     }\n     if {[catch {set bdf [open $cmd r]} err]} {\n-- \n1.8.0\n"},{"id":"202091","messageId":"508E264C.5080005@viscovery.net","threadId":"31944","inReplyTo":"1351185801-18543-2-git-send-email-felipe.contreras@gmail.com","subject":"Re: [PATCH 1/2] gitk: simplify file filtering","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2012-10-29T06:46:36Z","receivedAt":"2012-10-29T06:46:36Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Am 10/25/2012 19:23, schrieb Felipe Contreras:\n> git diff is perfectly able to do this with '-- files', no need for\n> manual filtering.\n\nIt would have been very useful if you summarized what the code did before\nthis change.\n\nAs for the change itself, it seems to make sense to use git diff's path\nlimiting instead of some home-grown method.\n\n-- Hannes\n"},{"id":"202092","messageId":"508E27A9.60105@viscovery.net","threadId":"31944","inReplyTo":"1351185801-18543-3-git-send-email-felipe.contreras@gmail.com","subject":"Re: [PATCH 2/2] gitk: handle --full-diff correctly","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2012-10-29T06:52:25Z","receivedAt":"2012-10-29T06:52:25Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Am 10/25/2012 19:23, schrieb Felipe Contreras:\n> Otherwise the files are missing from the diff, and the list of files.\n> \n> We do this by creating a limitdiffs variable specific for the view which\n> can be turned of by using --full-diff.\n\nIt would be very helpful if you described the problem. \"Try it yourself\"\nis not the answer. In particular, what does \"correctly\" mean in this\ncontext? Isn't the subject more like \"gitk: handle --full-diff\" in the\nsense that it wasn't handled at all previously and it did what it happened\nto do?\n\nThe patch breaks gitk's builtin \"limit to listed paths\" option - with the\npatch, the option is only honored at startup, but not when it is changed\nduring the session when --full-diff is not given. Don't know what should\nhappen if it is given.\n\n-- Hannes\n"}]}