{"thread":{"id":"64566","subject":"[PATCH] gitk: fix history window panes position","startedAt":"2025-12-02T13:09:02Z","lastAt":"2025-12-05T07:22:58Z","messageCount":8,"participants":["tobias.boesch@miele.com","Johannes Sixt","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"531555","messageId":"AM0PR08MB5426BC141388A69BB5087732E1D8A@AM0PR08MB5426.eurprd08.prod.outlook.com","threadId":"64566","inReplyTo":null,"subject":"[PATCH] gitk: fix history window panes position","fromName":"tobias.boesch@miele.com","fromEmail":"tobias.boesch@miele.com","sentAt":"2025-12-02T13:08:21Z","receivedAt":"2025-12-02T13:09:02Z","isPatch":true,"sender":{"key":"tobias.boesch@miele.com","avatar":"https://avatars.githubusercontent.com/u/64197724?v=4"},"body":"From b2ca7abc7d7efffc7312859b700780abb927e0b3 Mon Sep 17 00:00:00 2001\nFrom: Tobias Boesch <tobias.boesch@miele.com>\nDate: Thu, 27 Nov 2025 11:27:16 +0100\nSubject: [PATCH] gitk: fix history window panes position\n\nWhen the history window panes in are resized\nby moving either of the two sashes and then\nthe gitk window is vertically resized,\nthe sashes fall back into their previous\nposition without respecting the users wish\nfor resizing.\nSave the sash position when the sashes are\nmoved to make them keep their position when\nthe window is resized afterwards.\n\nWhen the gitk window is opened and maximized\non a screen, then closed and opened on a\nscreen smaller than the previously used one,\nthe author pane and time pane of the history\nwindow only are a few pixels wide and their\ncontents are barely visible.\nWiden the two panes on start of gitk to a\nreasonable fixed size that shows a good amount\nof text of authors and time.\n\nSigned-off-by: Tobias Boesch <tobias.boesch@miele.com>\n---\n\nNotes:\n    Debug print statements are left in the code for easier\n    testing by maintainers.\n    They will be removed when the review is finished.\n\n gitk-git/gitk | 41 +++++++++++++++++++++++++++++++++++++++++\n 1 file changed, 41 insertions(+)\n\ndiff --git a/gitk-git/gitk b/gitk-git/gitk\nindex 7f62c8041d..6fbc2588fb 100755\n--- a/gitk-git/gitk\n+++ b/gitk-git/gitk\n@@ -2471,6 +2471,23 @@ proc makewindow {} {\n         -xscrollincr $linespc \\\n         -yscrollincr $linespc -yscrollcommand \"scrollcanv $cscroll\"\n     .tf.histframe.pwclist add $canv\n+    bind .tf.histframe.pwclist.canv <Configure> {\n+        global oldsash\n+        set parent [regsub {\\.[A-Za-z]+$} %W \"\"]\n+        puts \"Canvas (pwclist) configuration changed saving sash \\\n+                position if parent panedwindow $parent is initialised \\\n+                (oldsash exist)\"\n+        if {[info exists oldsash($parent)]} {\n+            set s0 [$parent sashpos 0]\n+            set s1 [$parent sashpos 1]\n+            puts \"   Sash0 is $s0\"\n+            puts \"   Sash1 is $s1\"\n+            set oldsash($parent) [list $s0 $s1]\n+            puts \"   oldsash saved for $parent\"\n+        } else {\n+            puts \"   oldsash not yet existing so oldsash is not saved for $parent\"\n+        }\n+    }\n     set canv2 .tf.histframe.pwclist.canv2\n     canvas $canv2 \\\n         -selectbackground $selectbgcolor \\\n@@ -3116,30 +3133,53 @@ proc savestuff {w} {\n\n proc resizeclistpanes {win w} {\n     global oldwidth oldsash\n+    puts \"Starting resizeclistpanes...\"\n     if {[info exists oldwidth($win)]} {\n         if {[info exists oldsash($win)]} {\n+            puts \"   Using oldsash from window\"\n             set s0 [lindex $oldsash($win) 0]\n             set s1 [lindex $oldsash($win) 1]\n+            puts \"   Sash0 is $s0\"\n+            puts \"   Sash1 is $s1\"\n         } else {\n+            puts \"   New window creation detected\"\n+            puts \"   Width is $w\"\n+            puts \"   Using sash from window sashpos directly\"\n             set s0 [$win sashpos 0]\n             set s1 [$win sashpos 1]\n+            puts \"   Sash0 is $s0\"\n+            puts \"   Sash1 is $s1\"\n+            if {$s1 > $w - 140} {\n+                puts \"      Sash1 greater than width - 140, setting max size\"\n+                set s1 [expr {$w - 140}]\n+                if {$s0 > $s1 - 300} {\n+                    puts \"         Sash0 greater than sash1 - 300, setting max size\"\n+                    set s0 [expr {$s1 - 300}]\n+                }\n+            }\n         }\n         if {$w < 60} {\n+            puts \"   Narrow window ($w), scaling sash in dependency to window width\"\n             set sash0 [expr {int($w/2 - 2)}]\n             set sash1 [expr {int($w*5/6 - 2)}]\n         } else {\n+            puts \"   Wide window ($w), scaling sash in dependency to old width, oldsash and window width\"\n             set factor [expr {1.0 * $w / $oldwidth($win)}]\n             set sash0 [expr {int($factor * [lindex $s0 0])}]\n             set sash1 [expr {int($factor * [lindex $s1 0])}]\n             if {$sash0 < 30} {\n+                puts \"      Sash0 too small, setting min size\"\n                 set sash0 30\n             }\n             if {$sash1 < $sash0 + 20} {\n+                puts \"      Sash1 smaller than sash0 + 20, setting min size\"\n                 set sash1 [expr {$sash0 + 20}]\n             }\n             if {$sash1 > $w - 10} {\n+                puts \"      Sash1 greater than width - 140, setting max size\"\n                 set sash1 [expr {$w - 10}]\n                 if {$sash0 > $sash1 - 20} {\n+                    puts \"         Sash0 greater than sash1 - 300, setting max size\"\n                     set sash0 [expr {$sash1 - 20}]\n                 }\n             }\n@@ -3149,6 +3189,7 @@ proc resizeclistpanes {win w} {\n         set oldsash($win) [list $sash0 $sash1]\n     }\n     set oldwidth($win) $w\n+    puts \"Finished resizeclistpanes...\"\n }\n\n proc resizecdetpanes {win w} {\n--\n2.47.1.windows.2\n\n\n\n\n-------------------------------------------------------------------------------------------------\nimperial-Werke oHG, Sitz Bünde, Registergericht Bad Oeynhausen - HRA 4825\n"},{"id":"531600","messageId":"AM0PR08MB5426A65AA721DCA6CACF6C7AE1D9A@AM0PR08MB5426.eurprd08.prod.outlook.com","threadId":"64566","inReplyTo":"AM0PR08MB5426BC141388A69BB5087732E1D8A@AM0PR08MB5426.eurprd08.prod.outlook.com","subject":"AW: [PATCH] gitk: fix history window panes position","fromName":"tobias.boesch@miele.com","fromEmail":"tobias.boesch@miele.com","sentAt":"2025-12-03T09:35:27Z","receivedAt":"2025-12-03T09:36:03Z","isPatch":true,"sender":{"key":"tobias.boesch@miele.com","avatar":"https://avatars.githubusercontent.com/u/64197724?v=4"},"body":"An addition for testing:\n\nTo test or simulate the usage of a smaller monitor\none can move both sashes of the history window all\nthe way to the right. Then close the application.\nThat are the same conditions as if using a smaller\nscreen, after using a bigger screen.\nOn restart of gitk the panes should then be resized\nautomatically to a reasonable size.\n\n> -----Ursprüngliche Nachricht-----\n> Von: Boesch, Tobias\n> Gesendet: Dienstag, 2. Dezember 2025 14:08\n> An: Git Mailing List <git@vger.kernel.org>\n> Cc: Johannes Sixt <j6t@kdbg.org>\n> Betreff: [PATCH] gitk: fix history window panes position\n>\n> From b2ca7abc7d7efffc7312859b700780abb927e0b3 Mon Sep 17 00:00:00\n> 2001\n> From: Tobias Boesch <tobias.boesch@miele.com>\n> Date: Thu, 27 Nov 2025 11:27:16 +0100\n> Subject: [PATCH] gitk: fix history window panes position\n>\n> When the history window panes in are resized by moving either of the two\n> sashes and then the gitk window is vertically resized, the sashes fall back into\n> their previous position without respecting the users wish for resizing.\n> Save the sash position when the sashes are moved to make them keep their\n> position when the window is resized afterwards.\n>\n> When the gitk window is opened and maximized on a screen, then closed and\n> opened on a screen smaller than the previously used one, the author pane and\n> time pane of the history window only are a few pixels wide and their contents\n> are barely visible.\n> Widen the two panes on start of gitk to a reasonable fixed size that shows a\n> good amount of text of authors and time.\n>\n> Signed-off-by: Tobias Boesch <tobias.boesch@miele.com>\n> ---\n>\n> Notes:\n>     Debug print statements are left in the code for easier\n>     testing by maintainers.\n>     They will be removed when the review is finished.\n>\n>  gitk-git/gitk | 41 +++++++++++++++++++++++++++++++++++++++++\n>  1 file changed, 41 insertions(+)\n>\n> diff --git a/gitk-git/gitk b/gitk-git/gitk index 7f62c8041d..6fbc2588fb 100755\n> --- a/gitk-git/gitk\n> +++ b/gitk-git/gitk\n> @@ -2471,6 +2471,23 @@ proc makewindow {} {\n>          -xscrollincr $linespc \\\n>          -yscrollincr $linespc -yscrollcommand \"scrollcanv $cscroll\"\n>      .tf.histframe.pwclist add $canv\n> +    bind .tf.histframe.pwclist.canv <Configure> {\n> +        global oldsash\n> +        set parent [regsub {\\.[A-Za-z]+$} %W \"\"]\n> +        puts \"Canvas (pwclist) configuration changed saving sash \\\n> +                position if parent panedwindow $parent is initialised \\\n> +                (oldsash exist)\"\n> +        if {[info exists oldsash($parent)]} {\n> +            set s0 [$parent sashpos 0]\n> +            set s1 [$parent sashpos 1]\n> +            puts \"   Sash0 is $s0\"\n> +            puts \"   Sash1 is $s1\"\n> +            set oldsash($parent) [list $s0 $s1]\n> +            puts \"   oldsash saved for $parent\"\n> +        } else {\n> +            puts \"   oldsash not yet existing so oldsash is not saved for $parent\"\n> +        }\n> +    }\n>      set canv2 .tf.histframe.pwclist.canv2\n>      canvas $canv2 \\\n>          -selectbackground $selectbgcolor \\ @@ -3116,30 +3133,53 @@ proc\n> savestuff {w} {\n>\n>  proc resizeclistpanes {win w} {\n>      global oldwidth oldsash\n> +    puts \"Starting resizeclistpanes...\"\n>      if {[info exists oldwidth($win)]} {\n>          if {[info exists oldsash($win)]} {\n> +            puts \"   Using oldsash from window\"\n>              set s0 [lindex $oldsash($win) 0]\n>              set s1 [lindex $oldsash($win) 1]\n> +            puts \"   Sash0 is $s0\"\n> +            puts \"   Sash1 is $s1\"\n>          } else {\n> +            puts \"   New window creation detected\"\n> +            puts \"   Width is $w\"\n> +            puts \"   Using sash from window sashpos directly\"\n>              set s0 [$win sashpos 0]\n>              set s1 [$win sashpos 1]\n> +            puts \"   Sash0 is $s0\"\n> +            puts \"   Sash1 is $s1\"\n> +            if {$s1 > $w - 140} {\n> +                puts \"      Sash1 greater than width - 140, setting max size\"\n> +                set s1 [expr {$w - 140}]\n> +                if {$s0 > $s1 - 300} {\n> +                    puts \"         Sash0 greater than sash1 - 300, setting max size\"\n> +                    set s0 [expr {$s1 - 300}]\n> +                }\n> +            }\n>          }\n>          if {$w < 60} {\n> +            puts \"   Narrow window ($w), scaling sash in dependency to window\n> width\"\n>              set sash0 [expr {int($w/2 - 2)}]\n>              set sash1 [expr {int($w*5/6 - 2)}]\n>          } else {\n> +            puts \"   Wide window ($w), scaling sash in dependency to old width,\n> oldsash and window width\"\n>              set factor [expr {1.0 * $w / $oldwidth($win)}]\n>              set sash0 [expr {int($factor * [lindex $s0 0])}]\n>              set sash1 [expr {int($factor * [lindex $s1 0])}]\n>              if {$sash0 < 30} {\n> +                puts \"      Sash0 too small, setting min size\"\n>                  set sash0 30\n>              }\n>              if {$sash1 < $sash0 + 20} {\n> +                puts \"      Sash1 smaller than sash0 + 20, setting min size\"\n>                  set sash1 [expr {$sash0 + 20}]\n>              }\n>              if {$sash1 > $w - 10} {\n> +                puts \"      Sash1 greater than width - 140, setting max size\"\n>                  set sash1 [expr {$w - 10}]\n>                  if {$sash0 > $sash1 - 20} {\n> +                    puts \"         Sash0 greater than sash1 - 300, setting max size\"\n>                      set sash0 [expr {$sash1 - 20}]\n>                  }\n>              }\n> @@ -3149,6 +3189,7 @@ proc resizeclistpanes {win w} {\n>          set oldsash($win) [list $sash0 $sash1]\n>      }\n>      set oldwidth($win) $w\n> +    puts \"Finished resizeclistpanes...\"\n>  }\n>\n>  proc resizecdetpanes {win w} {\n> --\n> 2.47.1.windows.2\n>\n\n\n\n-------------------------------------------------------------------------------------------------\nimperial-Werke oHG, Sitz Bünde, Registergericht Bad Oeynhausen - HRA 4825\n"},{"id":"531601","messageId":"9a9441d5-fb64-4718-8765-852e66458598@kdbg.org","threadId":"64566","inReplyTo":"AM0PR08MB5426BC141388A69BB5087732E1D8A@AM0PR08MB5426.eurprd08.prod.outlook.com","subject":"Re: [PATCH] gitk: fix history window panes position","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2025-12-03T10:15:20Z","receivedAt":"2025-12-03T10:15:37Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Am 02.12.25 um 14:08 schrieb tobias.boesch@miele.com:\n> From: Tobias Boesch <tobias.boesch@miele.com>\n> Date: Thu, 27 Nov 2025 11:27:16 +0100\n> Subject: [PATCH] gitk: fix history window panes position\n> \n> When the history window panes in are resized\n> by moving either of the two sashes and then\n> the gitk window is vertically resized,\n> the sashes fall back into their previous\n> position without respecting the users wish\n> for resizing.\n\nYou say \"the Gitk windows is resized vertically\". Did you mean \"resized\nhorizontally\"? If I change only the height of the Gitk window, the\nwidths of the top panel (history, author, date) aren't changed at all.\nHowever, if I change only the width, the symptoms do occur.\n\nAlso, the error is not limited to the upper half of the window. The\nlower panel (patch text, file list) also forgets the last used position\nwhen the window size is changed. Can we fix this, too?\n\n> Save the sash position when the sashes are\n> moved to make them keep their position when\n> the window is resized afterwards.\n> \n> When the gitk window is opened and maximized\n> on a screen, then closed and opened on a\n> screen smaller than the previously used one,\n> the author pane and time pane of the history\n> window only are a few pixels wide and their\n> contents are barely visible.\n> Widen the two panes on start of gitk to a\n> reasonable fixed size that shows a good amount\n> of text of authors and time.\n\nI did this test:\n\n0. Make Gitk significantly less than the screen size.\n1. Adjust pane size to 1/2 history, 1/3 author, 1/6 date.\n2. Maximize window via \"Maximize\" button.\n3. Restore window via \"Maximize\" button.\n\nAfter 2., the pane widths are scaled with the window width and retain\ntheir proportions (or so it seems).\n\nBut after 3., the pane widths are completely scrambled. The date pane is\nfar too wide (wider than in the maximized window), the history pane\nsteals a lot of the remaining width, and the author pane is squished to\na minimal size.\n\nThe behavior without the patch was better in this regard, because the\nproportions of the memoized panel widths were retained.\n\n> \n> Signed-off-by: Tobias Boesch <tobias.boesch@miele.com>\n> ---\n> \n> Notes:\n>     Debug print statements are left in the code for easier\n>     testing by maintainers.\n>     They will be removed when the review is finished.\n> \n>  gitk-git/gitk | 41 +++++++++++++++++++++++++++++++++++++++++\n>  1 file changed, 41 insertions(+)\n> \n> diff --git a/gitk-git/gitk b/gitk-git/gitk\n> index 7f62c8041d..6fbc2588fb 100755\n> --- a/gitk-git/gitk\n> +++ b/gitk-git/gitk\n> @@ -2471,6 +2471,23 @@ proc makewindow {} {\n>          -xscrollincr $linespc \\\n>          -yscrollincr $linespc -yscrollcommand \"scrollcanv $cscroll\"\n>      .tf.histframe.pwclist add $canv\n> +    bind .tf.histframe.pwclist.canv <Configure> {\n> +        global oldsash\n> +        set parent [regsub {\\.[A-Za-z]+$} %W \"\"]\n> +        puts \"Canvas (pwclist) configuration changed saving sash \\\n> +                position if parent panedwindow $parent is initialised \\\n> +                (oldsash exist)\"\n> +        if {[info exists oldsash($parent)]} {\n> +            set s0 [$parent sashpos 0]\n> +            set s1 [$parent sashpos 1]\n> +            puts \"   Sash0 is $s0\"\n> +            puts \"   Sash1 is $s1\"\n> +            set oldsash($parent) [list $s0 $s1]\n> +            puts \"   oldsash saved for $parent\"\n> +        } else {\n> +            puts \"   oldsash not yet existing so oldsash is not saved for $parent\"\n> +        }\n> +    }\n\nI wonder why this handler is only installed for one of the three panes.\n\nDoes panedwindow not have any features that can notify us to store the\ncurrent sash positions? Can we perhaps bind to its <Motion> or\n<ButtonRelease> instead?\n\nAt any rate, a callback like this is large enough (even without\ndebugging code) to be moved to its own function. Is there a reason that\nproc resizeclistpanes cannot be reused in some way?\n\n>      set canv2 .tf.histframe.pwclist.canv2\n>      canvas $canv2 \\\n>          -selectbackground $selectbgcolor \\\n> @@ -3116,30 +3133,53 @@ proc savestuff {w} {\n> \n>  proc resizeclistpanes {win w} {\n>      global oldwidth oldsash\n> +    puts \"Starting resizeclistpanes...\"\n>      if {[info exists oldwidth($win)]} {\n>          if {[info exists oldsash($win)]} {\n> +            puts \"   Using oldsash from window\"\n>              set s0 [lindex $oldsash($win) 0]\n>              set s1 [lindex $oldsash($win) 1]\n> +            puts \"   Sash0 is $s0\"\n> +            puts \"   Sash1 is $s1\"\n>          } else {\n> +            puts \"   New window creation detected\"\n> +            puts \"   Width is $w\"\n> +            puts \"   Using sash from window sashpos directly\"\n>              set s0 [$win sashpos 0]\n>              set s1 [$win sashpos 1]\n> +            puts \"   Sash0 is $s0\"\n> +            puts \"   Sash1 is $s1\"\n> +            if {$s1 > $w - 140} {\n> +                puts \"      Sash1 greater than width - 140, setting max size\"\n> +                set s1 [expr {$w - 140}]\n> +                if {$s0 > $s1 - 300} {> +                    puts \"\n      Sash0 greater than sash1 - 300, setting max size\"\n> +                    set s0 [expr {$s1 - 300}]\n\nSo, these aren't \"max size\", but actually \"minimal width\".\n\nIt is strange that the minimal width of the author pane is only\ncorrected if the date pane is too small as well.\n\nI have an issue with this. If the user makes the panes small, the wider\nversions are forced on them. The user's wish should have priority.\n\nI understand that you want to restore the widths to a sane size after\nthe \"maximize-restore\" operation has caused the degenerated widths. But\ndoesn't this solution just paper over the real bug that the window\nresize operation doesn't heed the pane width proportions?\n\n> +                }\n> +            }\n>          }\n>          if {$w < 60} {\n> +            puts \"   Narrow window ($w), scaling sash in dependency to window width\"\n>              set sash0 [expr {int($w/2 - 2)}]\n>              set sash1 [expr {int($w*5/6 - 2)}]\n>          } else {\n> +            puts \"   Wide window ($w), scaling sash in dependency to old width, oldsash and window width\"\n>              set factor [expr {1.0 * $w / $oldwidth($win)}]\n>              set sash0 [expr {int($factor * [lindex $s0 0])}]\n>              set sash1 [expr {int($factor * [lindex $s1 0])}]\n\nNot a problem of this patch, but I wonder why we have [lindex] here.\n\n>              if {$sash0 < 30} {\n> +                puts \"      Sash0 too small, setting min size\"\n>                  set sash0 30\n>              }\n>              if {$sash1 < $sash0 + 20} {\n> +                puts \"      Sash1 smaller than sash0 + 20, setting min size\"\n>                  set sash1 [expr {$sash0 + 20}]\n>              }\n>              if {$sash1 > $w - 10} {\n> +                puts \"      Sash1 greater than width - 140, setting max size\"\n>                  set sash1 [expr {$w - 10}]\n>                  if {$sash0 > $sash1 - 20} {\n> +                    puts \"         Sash0 greater than sash1 - 300, setting max size\"\n>                      set sash0 [expr {$sash1 - 20}]\n>                  }\n>              }\n> @@ -3149,6 +3189,7 @@ proc resizeclistpanes {win w} {\n>          set oldsash($win) [list $sash0 $sash1]\n>      }\n>      set oldwidth($win) $w\n> +    puts \"Finished resizeclistpanes...\"\n>  }\n> \n>  proc resizecdetpanes {win w} {\n-- Hannes\n\n"},{"id":"531648","messageId":"DB8PR08MB5433FCF25C0693952E0E67BEE1A6A@DB8PR08MB5433.eurprd08.prod.outlook.com","threadId":"64566","inReplyTo":"9a9441d5-fb64-4718-8765-852e66458598@kdbg.org","subject":"AW: [PATCH] gitk: fix history window panes position","fromName":"tobias.boesch@miele.com","fromEmail":"tobias.boesch@miele.com","sentAt":"2025-12-04T08:39:51Z","receivedAt":"2025-12-04T08:41:03Z","isPatch":true,"sender":{"key":"tobias.boesch@miele.com","avatar":"https://avatars.githubusercontent.com/u/64197724?v=4"},"body":"Some quick responses inlined below.\nI'll look into the rest of your annotations and try to directly provide a second\nversion of the patch.\n\n> -----Ursprüngliche Nachricht-----\n> Von: Johannes Sixt <j6t@kdbg.org>\n> Gesendet: Mittwoch, 3. Dezember 2025 11:15\n> An: Boesch, Tobias <tobias.boesch@miele.com>\n> Cc: Git Mailing List <git@vger.kernel.org>\n> Betreff: Re: [PATCH] gitk: fix history window panes position\n>\n> Am 02.12.25 um 14:08 schrieb tobias.boesch@miele.com:\n> > From: Tobias Boesch <tobias.boesch@miele.com>\n> > Date: Thu, 27 Nov 2025 11:27:16 +0100\n> > Subject: [PATCH] gitk: fix history window panes position\n> >\n> > When the history window panes in are resized by moving either of the\n> > two sashes and then the gitk window is vertically resized, the sashes\n> > fall back into their previous position without respecting the users\n> > wish for resizing.\n>\n> You say \"the Gitk windows is resized vertically\". Did you mean \"resized\n> horizontally\"? If I change only the height of the Gitk window, the widths of the\n> top panel (history, author, date) aren't changed at all.\n> However, if I change only the width, the symptoms do occur.\n\nYou're right. I meant horizontally. Will be changed in the commit message.\n\n>\n> Also, the error is not limited to the upper half of the window. The lower panel\n> (patch text, file list) also forgets the last used position when the window size is\n> changed. Can we fix this, too?\n\nYes I plan to do that, but I thought it would be too big for one commit since it is\na slightly different part of the app.\nI wanted to put this in a separate patch, since I just started with using emails and\nthe git mailing list directly instead of using gitgitgadjet. That's all new to me and\nI didn't want to start with a series of patches on this first try.\nWould you like to have that fix in this patch and convert this patch into a series\n(somehow) or is it okay to put it in a separate patch?\n\nTobias\n\n\n-------------------------------------------------------------------------------------------------\nimperial-Werke oHG, Sitz Bünde, Registergericht Bad Oeynhausen - HRA 4825\n"},{"id":"531650","messageId":"9f7af47a-ae39-4931-805d-f6e4549231ac@kdbg.org","threadId":"64566","inReplyTo":"DB8PR08MB5433FCF25C0693952E0E67BEE1A6A@DB8PR08MB5433.eurprd08.prod.outlook.com","subject":"Re: [PATCH] gitk: fix history window panes position","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2025-12-04T09:20:52Z","receivedAt":"2025-12-04T09:21:04Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Am 04.12.25 um 09:39 schrieb tobias.boesch@miele.com:\n>> Von: Johannes Sixt <j6t@kdbg.org>\n>> Also, the error is not limited to the upper half of the window. The lower panel\n>> (patch text, file list) also forgets the last used position when the window size is\n>> changed. Can we fix this, too?\n> \n> Yes I plan to do that, but I thought it would be too big for one commit since it is\n> a slightly different part of the app.\n> I wanted to put this in a separate patch, since I just started with using emails and\n> the git mailing list directly instead of using gitgitgadjet. That's all new to me and\n> I didn't want to start with a series of patches on this first try.\n> Would you like to have that fix in this patch and convert this patch into a series\n> (somehow) or is it okay to put it in a separate patch?\nIt depends on the solution needed. If they are the same approach, it can\nbe a single patch. Otherwise, a separate patch may make sense.\n\nBTW, the email that I received was not usable for git-am because its\nbody was base64-encoded. I had to copy the text from my MUA to a text\nfile before I could apply it with git-am. If you have trouble sending\nout unencoded, raw text mails, please use Gitgitgadget if there is more\nthan one patch in the series.\n\n-- Hannes\n\n"},{"id":"531679","messageId":"xmqq5xal8y5s.fsf@gitster.g","threadId":"64566","inReplyTo":"9f7af47a-ae39-4931-805d-f6e4549231ac@kdbg.org","subject":"Re: [PATCH] gitk: fix history window panes position","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2025-12-05T02:23:11Z","receivedAt":"2025-12-05T02:23:13Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Sixt <j6t@kdbg.org> writes:\n\n> BTW, the email that I received was not usable for git-am because its\n> body was base64-encoded. I had to copy the text from my MUA to a text\n> file before I could apply it with git-am. If you have trouble sending\n> out unencoded, raw text mails, please use Gitgitgadget if there is more\n> than one patch in the series.\n\n\"git am\" (actually \"git mailsplit\" that is called from it to extract\nwhat can be used by \"git apply\") should be able to deal with\n\n    Content-Type: text/plain; charset=\"utf-8\"\n    Content-Transfer-Encoding: base64\n\nso there may be something else going on.  The rendition at lore\n\nhttps://lore.kernel.org/git/AM0PR08MB5426BC141388A69BB5087732E1D8A@AM0PR08MB5426.eurprd08.prod.outlook.com/\n\nseems to show that it has in-body headers that should have been\nmoved to e-mail headers, but otherwise it looks more or less like\nlegit patch e-mail without anything unusual.  It could be the patch\nmay be full of ^M, but we cannot tell from the way lore/public-inbox\nshows its messages.\n\n"},{"id":"531680","messageId":"db513191-5f3d-489e-b91a-a788f70b9e8c@kdbg.org","threadId":"64566","inReplyTo":"xmqq5xal8y5s.fsf@gitster.g","subject":"Re: [PATCH] gitk: fix history window panes position","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2025-12-05T06:40:01Z","receivedAt":"2025-12-05T06:40:11Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Am 05.12.25 um 03:23 schrieb Junio C Hamano:\n> \"git am\" (actually \"git mailsplit\" that is called from it to extract\n> what can be used by \"git apply\") should be able to deal with\n> \n>     Content-Type: text/plain; charset=\"utf-8\"\n>     Content-Transfer-Encoding: base64\n> \n> so there may be something else going on.\n\nAh! You are absolutely right! Clearly, I wasn't fully taking in what\ngit-am was telling me. The problem isn't the encoding. It's the patch\ntext itself, in particular, the single SP needed for empty context lines\nis missing.\n\nI get this error when I apply the mbox containing the complete email:\n\n$ git am -3 --signoff ~/Mail/ambox\nwarning: quoted CRLF detected\nApplying: gitk: fix history window panes position\nerror: corrupt patch at line 40\nerror: could not build fake ancestor\nPatch failed at 0001 gitk: fix history window panes position\nhint: Use 'git am --show-current-patch=diff' to see the failed patch\nhint: [...]\n\nBut it is OK to copy the email body text to a file (which looks like\nmbox text) and apply that, despite the missing SP:\n\n$ git am -3 --signoff bla.patch\nApplying: gitk: fix history window panes position\nUsing index info to reconstruct a base tree...\nA       gitk-git/gitk\nFalling back to patching base and 3-way merge...\n\nWhy is that?\n\n-- Hannes\n\n"},{"id":"531681","messageId":"xmqqzf7x75pz.fsf@gitster.g","threadId":"64566","inReplyTo":"db513191-5f3d-489e-b91a-a788f70b9e8c@kdbg.org","subject":"Re: [PATCH] gitk: fix history window panes position","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2025-12-05T07:22:48Z","receivedAt":"2025-12-05T07:22:58Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Sixt <j6t@kdbg.org> writes:\n\n> Ah! You are absolutely right! Clearly, I wasn't fully taking in what\n> git-am was telling me. The problem isn't the encoding. It's the patch\n> text itself, in particular, the single SP needed for empty context lines\n> is missing.\n\nI do not think that is the case, either.  diff.suppressBlankEmpty is\npart of Git for quite some time.  The \"empty context lines can be\nexpressed as a totally empty line\" was started at GNU IIRC, but I\nthink POSIX allows it these days.  And we can take it, as you found\nout with your \"bla.patch\" experiment below.\n\n> I get this error when I apply the mbox containing the complete email:\n>\n> $ git am -3 --signoff ~/Mail/ambox\n> warning: quoted CRLF detected\n> Applying: gitk: fix history window panes position\n> error: corrupt patch at line 40\n> error: could not build fake ancestor\n> Patch failed at 0001 gitk: fix history window panes position\n> hint: Use 'git am --show-current-patch=diff' to see the failed patch\n> hint: [...]\n>\n> But it is OK to copy the email body text to a file (which looks like\n> mbox text) and apply that, despite the missing SP:\n>\n> $ git am -3 --signoff bla.patch\n> Applying: gitk: fix history window panes position\n> Using index info to reconstruct a base tree...\n> A       gitk-git/gitk\n> Falling back to patching base and 3-way merge...\n>\n> Why is that?\n\nSo the reason you seek is because you are barking up a wrong tree?\n\nThere probably is something wrong in the patch text that has nothing\nto do with diff.suppressBlankEmpty that you somehow \"fixed\" without\nknowing when you massaged the e-mail message into the \"bla.patch\"\ntext yourself manually, if I have to guess.\n"}]}