threads / discuss / 51786

git-gui: Long lines in commit message gets hidden, no scrollbar appears

Subject: git-gui: Long lines in commit message gets hidden, no scrollbar appears

## tl;dr

18 messages between Sep 2, 2019 and Sep 4, 2019.

replies: 17people: 4as markdown or json

Birger Skogeng Pedersen· Sep 2, 2019, 09:11 UTC · lore
Hi,

I just noticed that long lines in the commit message widget does in fact not show a horizontal scrollbar. So if a line in the commit message is more than 75 characters, it gets a bit confusing. Should it not have a scrollbar? Example shown here: https://i.imgur.com/I3d6nBJ.png

Bert Wesarg· Sep 2, 2019, 12:05 UTC · re: Birger Skogeng Pedersen · lore

Re: git-gui: Long lines in commit message gets hidden, no scrollbar appears

Hi Birger,

On Mon, Sep 2, 2019 at 11:13 AM Birger Skogeng Pedersen <birger.sp@gmail.com> wrote:

Show 9 quoted lines
>
> Hi,
>
> I just noticed that long lines in the commit message widget does in
> fact not show a horizontal scrollbar.
> So if a line in the commit message is more than 75 characters, it gets
> a bit confusing.
> Should it not have a scrollbar?
> Example shown here: https://i.imgur.com/I3d6nBJ.png

the old reasoning was, that you should not create commit messages which are too wide. While I can follow this reasoning, hiding content is also not a good idea. Thus I tried a different aproach. Instead of not showing the content, I pop up a dialog, if the commit message contains too long lines and add you requested scrollbar.

As I'm currently unable to send patches per mail, I pushed it to GitHub:
https://github.com/bertwesarg/git-gui/tree/bw/commit-scrollbuffer
And I will paste the scrollbuffer commit below.

Best, Bert

Author: Bert Wesarg <bert.wesarg@googlemail.com>
Date:   Mon Sep 2 13:57:24 2019 +0200
    git-gui: add horizontal scrollbar to commit buffer
    Sugestted-by: Birger Skogeng Pedersen <birger.sp@gmail.com>
    Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
diff --git a/git-gui.sh b/git-gui.sh
index a491085..919d1e9 100755
--- a/git-gui.sh
+++ b/git-gui.sh
@@ -3363,14 +3363,20 @@ ttext $ui_comm -background white -foreground black \
        -relief sunken \
        -width $repo_config(gui.commitmsgwidth) -height 9 -wrap none \
        -font font_diff \
-       -yscrollcommand {.vpane.lower.commarea.buffer.frame.sby set}
+       -yscrollcommand {.vpane.lower.commarea.buffer.frame.sby set} \
+       -xscrollcommand {.vpane.lower.commarea.buffer.sbx set}
 ${NS}::scrollbar .vpane.lower.commarea.buffer.frame.sby \
+       -orient vertical \
        -command [list $ui_comm yview]
+${NS}::scrollbar .vpane.lower.commarea.buffer.sbx \
+       -orient horizontal \
+       -command [list $ui_comm xview]

 pack .vpane.lower.commarea.buffer.frame.sby -side right -fill y
 pack $ui_comm -side left -fill y
+pack .vpane.lower.commarea.buffer.sbx -side bottom -fill x
 pack .vpane.lower.commarea.buffer.header -side top -fill x
-pack .vpane.lower.commarea.buffer.frame -side left -fill y
+pack .vpane.lower.commarea.buffer.frame -side top -fill x
 pack .vpane.lower.commarea.buffer -side left -fill y

 # -- Commit Message Buffer Context Menu
Birger Skogeng Pedersen· Sep 2, 2019, 17:04 UTC · re: Bert Wesarg · lore

Re: git-gui: Long lines in commit message gets hidden, no scrollbar appears

Hi Bert,

Thanks for picking this up. I just gave your patch a go, and I think there are a couple of issues.

Applying the patch yields:
$ git apply patch1.patch
patch1.patch:18: indent with spaces.
       -yscrollcommand {.vpane.lower.commarea.buffer.frame.sby set} \
patch1.patch:19: indent with spaces.
       -xscrollcommand {.vpane.lower.commarea.buffer.sbx set}
patch1.patch:21: indent with spaces.
       -orient vertical \
patch1.patch:24: indent with spaces.
       -orient horizontal \
patch1.patch:25: indent with spaces.
       -command [list $ui_comm xview]
warning: git-gui.sh has type 100644, expected 100755
error: patch failed: git-gui.sh:3363
error: git-gui.sh: patch does not apply

Replacing the spaces with tabs before applying, I notice the horisontal scrollbar appears to be "outside" of the text input area. And it doesn't follow the height of the commit message text input area. Here's a screenshot: https://i.imgur.com/721axUX.png

Birger
On Mon, Sep 2, 2019 at 2:06 PM Bert Wesarg <bert.wesarg@googlemail.com> wrote:
Show 65 quoted lines
>
> Hi Birger,
>
> On Mon, Sep 2, 2019 at 11:13 AM Birger Skogeng Pedersen
> <birger.sp@gmail.com> wrote:
> >
> > Hi,
> >
> > I just noticed that long lines in the commit message widget does in
> > fact not show a horizontal scrollbar.
> > So if a line in the commit message is more than 75 characters, it gets
> > a bit confusing.
> > Should it not have a scrollbar?
> > Example shown here: https://i.imgur.com/I3d6nBJ.png
>
> the old reasoning was, that you should not create commit messages
> which are too wide. While I can follow this reasoning, hiding content
> is also not a good idea. Thus I tried a different aproach. Instead of
> not showing the content, I pop up a dialog, if the commit message
> contains too long lines and add you requested scrollbar.
>
> As I'm currently unable to send patches per mail, I pushed it to GitHub:
>
> https://github.com/bertwesarg/git-gui/tree/bw/commit-scrollbuffer
>
> And I will paste the scrollbuffer commit below.
>
> Best,
> Bert
>
> Author: Bert Wesarg <bert.wesarg@googlemail.com>
> Date:   Mon Sep 2 13:57:24 2019 +0200
>
>     git-gui: add horizontal scrollbar to commit buffer
>
>     Sugestted-by: Birger Skogeng Pedersen <birger.sp@gmail.com>
>     Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
>
> diff --git a/git-gui.sh b/git-gui.sh
> index a491085..919d1e9 100755
> --- a/git-gui.sh
> +++ b/git-gui.sh
> @@ -3363,14 +3363,20 @@ ttext $ui_comm -background white -foreground black \
>         -relief sunken \
>         -width $repo_config(gui.commitmsgwidth) -height 9 -wrap none \
>         -font font_diff \
> -       -yscrollcommand {.vpane.lower.commarea.buffer.frame.sby set}
> +       -yscrollcommand {.vpane.lower.commarea.buffer.frame.sby set} \
> +       -xscrollcommand {.vpane.lower.commarea.buffer.sbx set}
>  ${NS}::scrollbar .vpane.lower.commarea.buffer.frame.sby \
> +       -orient vertical \
>         -command [list $ui_comm yview]
> +${NS}::scrollbar .vpane.lower.commarea.buffer.sbx \
> +       -orient horizontal \
> +       -command [list $ui_comm xview]
>
>  pack .vpane.lower.commarea.buffer.frame.sby -side right -fill y
>  pack $ui_comm -side left -fill y
> +pack .vpane.lower.commarea.buffer.sbx -side bottom -fill x
>  pack .vpane.lower.commarea.buffer.header -side top -fill x
> -pack .vpane.lower.commarea.buffer.frame -side left -fill y
> +pack .vpane.lower.commarea.buffer.frame -side top -fill x
>  pack .vpane.lower.commarea.buffer -side left -fill y
>
>  # -- Commit Message Buffer Context Menu
Pratyush Yadav· Sep 2, 2019, 18:12 UTC · re: Birger Skogeng Pedersen · lore

Re: git-gui: Long lines in commit message gets hidden, no scrollbar appears

On 02/09/19 07:04PM, Birger Skogeng Pedersen wrote:
Show 23 quoted lines
> Hi Bert,
> 
> 
> Thanks for picking this up.
> I just gave your patch a go, and I think there are a couple of issues.
> 
> 
> Applying the patch yields:
> 
> $ git apply patch1.patch
> patch1.patch:18: indent with spaces.
>        -yscrollcommand {.vpane.lower.commarea.buffer.frame.sby set} \
> patch1.patch:19: indent with spaces.
>        -xscrollcommand {.vpane.lower.commarea.buffer.sbx set}
> patch1.patch:21: indent with spaces.
>        -orient vertical \
> patch1.patch:24: indent with spaces.
>        -orient horizontal \
> patch1.patch:25: indent with spaces.
>        -command [list $ui_comm xview]
> warning: git-gui.sh has type 100644, expected 100755
> error: patch failed: git-gui.sh:3363
> error: git-gui.sh: patch does not apply
 
It applied fine for me. I got the patch from Bert's GitHub since he said 
he is "unable to send patches per mail". You can run
  wget https://github.com/bertwesarg/git-gui/commit/0bfa0645127c8242a260f1dfe45d7d4c310fa868.patch

to get the .patch file, and then apply that. Maybe his email client messed up somewhere, and that's why your patch has whitespace problems.

Show 5 quoted lines
> Replacing the spaces with tabs before applying, I notice the
> horisontal scrollbar appears to be "outside" of the text input area.
> And it doesn't follow the height of the commit message text input
> area.
> Here's a screenshot: https://i.imgur.com/721axUX.png
 
Hmm, it looks fine for me. Which platform are you using? I am running it 
on Linux. Screenshot: https://imgur.com/sNp5Ktq
-- 
Regards,
Pratyush Yadav
Birger Skogeng Pedersen· Sep 2, 2019, 18:22 UTC · re: Pratyush Yadav · lore

Re: git-gui: Long lines in commit message gets hidden, no scrollbar appears

On Mon, Sep 2, 2019 at 8:05 PM Bert Wesarg <bert.wesarg@googlemail.com> wrote:
> I cannot test windows easily, it looks good on Linux Tcl /Tk 8.6:
>
> https://kgab.selfhost.eu/s/f38GX4caCZBj4mZ
On Mon, Sep 2, 2019 at 8:12 PM Pratyush Yadav <me@yadavpratyush.com> wrote:
> Hmm, it looks fine for me. Which platform are you using? I am running it
> on Linux. Screenshot: https://imgur.com/sNp5Ktq

Try resizing the bottom right pane of git gui, you should see that the scrollbar remains at the bottom while the input area moves upwards. If not, then it must be a windows-only problem. From Bert's screenshot you can see that there is a (small) spacer between the scrollbar and the input area.

Please have a look at this: https://i.imgur.com/unAflET.png

Br, Birger

Pratyush Yadav· Sep 2, 2019, 18:44 UTC · re: Birger Skogeng Pedersen · lore

Re: git-gui: Long lines in commit message gets hidden, no scrollbar appears

On 02/09/19 08:22PM, Birger Skogeng Pedersen wrote:
Show 11 quoted lines
> On Mon, Sep 2, 2019 at 8:05 PM Bert Wesarg <bert.wesarg@googlemail.com> wrote:
> > I cannot test windows easily, it looks good on Linux Tcl /Tk 8.6:
> >
> > https://kgab.selfhost.eu/s/f38GX4caCZBj4mZ
> 
> On Mon, Sep 2, 2019 at 8:12 PM Pratyush Yadav <me@yadavpratyush.com> wrote:
> > Hmm, it looks fine for me. Which platform are you using? I am running it
> > on Linux. Screenshot: https://imgur.com/sNp5Ktq
> 
> Try resizing the bottom right pane of git gui, you should see that the
> scrollbar remains at the bottom while the input area moves upwards.

Yes, I can reproduce the problem when I do this. Interestingly, the vertical scrollbar does move, the horizontal one (which Bert just added) doesn't. So I think there is a slight difference in how the horizontal scrollbar is set up that is causing this.

Show 9 quoted lines
> If not, then it must be a windows-only problem.
> From Bert's screenshot you can see that there is a (small) spacer
> between the scrollbar and the input area.
> 
> Please have a look at this: https://i.imgur.com/unAflET.png
> 
> 
> Br,
> Birger
-- 
Regards,
Pratyush Yadav
Pratyush Yadav· Sep 2, 2019, 18:58 UTC · re: Pratyush Yadav · lore

Re: git-gui: Long lines in commit message gets hidden, no scrollbar appears

On 03/09/19 12:14AM, Pratyush Yadav wrote:
Show 17 quoted lines
> On 02/09/19 08:22PM, Birger Skogeng Pedersen wrote:
> > On Mon, Sep 2, 2019 at 8:05 PM Bert Wesarg <bert.wesarg@googlemail.com> wrote:
> > > I cannot test windows easily, it looks good on Linux Tcl /Tk 8.6:
> > >
> > > https://kgab.selfhost.eu/s/f38GX4caCZBj4mZ
> > 
> > On Mon, Sep 2, 2019 at 8:12 PM Pratyush Yadav <me@yadavpratyush.com> wrote:
> > > Hmm, it looks fine for me. Which platform are you using? I am running it
> > > on Linux. Screenshot: https://imgur.com/sNp5Ktq
> > 
> > Try resizing the bottom right pane of git gui, you should see that the
> > scrollbar remains at the bottom while the input area moves upwards.
> 
> Yes, I can reproduce the problem when I do this. Interestingly, the 
> vertical scrollbar does move, the horizontal one (which Bert just added) 
> doesn't. So I think there is a slight difference in how the horizontal 
> scrollbar is set up that is causing this.
 
On second thought, wouldn't it make more sense to expand the commit 
message buffer instead? The point of resizing that pane is to see more 
of the commit message. So it makes more sense to make the commit message 
buffer take up all the vertical space, rather than making the scrollbar 
move.
-- 
Regards,
Pratyush Yadav
Bert Wesarg· Sep 2, 2019, 19:03 UTC · re: Pratyush Yadav · lore

Re: git-gui: Long lines in commit message gets hidden, no scrollbar appears

On Mon, Sep 2, 2019 at 8:58 PM Pratyush Yadav <me@yadavpratyush.com> wrote:
Show 25 quoted lines
>
> On 03/09/19 12:14AM, Pratyush Yadav wrote:
> > On 02/09/19 08:22PM, Birger Skogeng Pedersen wrote:
> > > On Mon, Sep 2, 2019 at 8:05 PM Bert Wesarg <bert.wesarg@googlemail.com> wrote:
> > > > I cannot test windows easily, it looks good on Linux Tcl /Tk 8.6:
> > > >
> > > > https://kgab.selfhost.eu/s/f38GX4caCZBj4mZ
> > >
> > > On Mon, Sep 2, 2019 at 8:12 PM Pratyush Yadav <me@yadavpratyush.com> wrote:
> > > > Hmm, it looks fine for me. Which platform are you using? I am running it
> > > > on Linux. Screenshot: https://imgur.com/sNp5Ktq
> > >
> > > Try resizing the bottom right pane of git gui, you should see that the
> > > scrollbar remains at the bottom while the input area moves upwards.
> >
> > Yes, I can reproduce the problem when I do this. Interestingly, the
> > vertical scrollbar does move, the horizontal one (which Bert just added)
> > doesn't. So I think there is a slight difference in how the horizontal
> > scrollbar is set up that is causing this.
>
> On second thought, wouldn't it make more sense to expand the commit
> message buffer instead? The point of resizing that pane is to see more
> of the commit message. So it makes more sense to make the commit message
> buffer take up all the vertical space, rather than making the scrollbar
> move.
it is, I just broke that ;-)
Bert
>
> --
> Regards,
> Pratyush Yadav
Bert Wesarg· Sep 2, 2019, 19:13 UTC · re: Bert Wesarg · lore

Re: git-gui: Long lines in commit message gets hidden, no scrollbar appears

On Mon, Sep 2, 2019 at 9:03 PM Bert Wesarg <bert.wesarg@googlemail.com> wrote:
Show 29 quoted lines
>
> On Mon, Sep 2, 2019 at 8:58 PM Pratyush Yadav <me@yadavpratyush.com> wrote:
> >
> > On 03/09/19 12:14AM, Pratyush Yadav wrote:
> > > On 02/09/19 08:22PM, Birger Skogeng Pedersen wrote:
> > > > On Mon, Sep 2, 2019 at 8:05 PM Bert Wesarg <bert.wesarg@googlemail.com> wrote:
> > > > > I cannot test windows easily, it looks good on Linux Tcl /Tk 8.6:
> > > > >
> > > > > https://kgab.selfhost.eu/s/f38GX4caCZBj4mZ
> > > >
> > > > On Mon, Sep 2, 2019 at 8:12 PM Pratyush Yadav <me@yadavpratyush.com> wrote:
> > > > > Hmm, it looks fine for me. Which platform are you using? I am running it
> > > > > on Linux. Screenshot: https://imgur.com/sNp5Ktq
> > > >
> > > > Try resizing the bottom right pane of git gui, you should see that the
> > > > scrollbar remains at the bottom while the input area moves upwards.
> > >
> > > Yes, I can reproduce the problem when I do this. Interestingly, the
> > > vertical scrollbar does move, the horizontal one (which Bert just added)
> > > doesn't. So I think there is a slight difference in how the horizontal
> > > scrollbar is set up that is causing this.
> >
> > On second thought, wouldn't it make more sense to expand the commit
> > message buffer instead? The point of resizing that pane is to see more
> > of the commit message. So it makes more sense to make the commit message
> > buffer take up all the vertical space, rather than making the scrollbar
> > move.
>
> it is, I just broke that ;-)
is fixed in GitHub:
    wget https://github.com/bertwesarg/git-gui/commit/56163547604f44688e208393f8941efaf5247d40.patch
Thanks.
Bert
Show 7 quoted lines
>
> Bert
>
> >
> > --
> > Regards,
> > Pratyush Yadav
Pratyush Yadav· Sep 3, 2019, 17:15 UTC · re: Bert Wesarg · lore

Re: git-gui: Long lines in commit message gets hidden, no scrollbar appears

On 02/09/19 09:13PM, Bert Wesarg wrote:
> On Mon, Sep 2, 2019 at 9:03 PM Bert Wesarg <bert.wesarg@googlemail.com> wrote:
> >
[snip]
Show 12 quoted lines
> > > On second thought, wouldn't it make more sense to expand the 
> > > commit
> > > message buffer instead? The point of resizing that pane is to see more
> > > of the commit message. So it makes more sense to make the commit message
> > > buffer take up all the vertical space, rather than making the scrollbar
> > > move.
> >
> > it is, I just broke that ;-)
> 
> is fixed in GitHub:
> 
>     wget https://github.com/bertwesarg/git-gui/commit/56163547604f44688e208393f8941efaf5247d40.patch
I tried the patch out. Works fine on Linux. Thanks.
There is a minor typo in your commit message.
> Sugestted-by: Birger Skogeng Pedersen <birger.sp@gmail.com>
s/Sugestted/Suggested/
> Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
One more observation:

If I write a particularly long line (and consequently the scrollbar becomes active), and then hit Ctrl+A to select all text, and then backspace to delete it all, the scrollbar does not get updated. It still shows the old position where is is "scrolled" halfway through. As soon as I type in any other character, it takes the correct state, and becomes disabled.

The vertical scrollbar behaves correctly in this scenario, and does take the correct state and position as soon as I delete all text, so I suspect it should be a small fix. Maybe a missed option or something like that?

-- 
Regards,
Pratyush Yadav
Bert Wesarg· Sep 4, 2019, 19:39 UTC · re: Pratyush Yadav · lore

Re: git-gui: Long lines in commit message gets hidden, no scrollbar appears

On Tue, Sep 3, 2019 at 7:15 PM Pratyush Yadav <me@yadavpratyush.com> wrote:
Show 41 quoted lines
>
> On 02/09/19 09:13PM, Bert Wesarg wrote:
> > On Mon, Sep 2, 2019 at 9:03 PM Bert Wesarg <bert.wesarg@googlemail.com> wrote:
> > >
> [snip]
> > > > On second thought, wouldn't it make more sense to expand the
> > > > commit
> > > > message buffer instead? The point of resizing that pane is to see more
> > > > of the commit message. So it makes more sense to make the commit message
> > > > buffer take up all the vertical space, rather than making the scrollbar
> > > > move.
> > >
> > > it is, I just broke that ;-)
> >
> > is fixed in GitHub:
> >
> >     wget https://github.com/bertwesarg/git-gui/commit/56163547604f44688e208393f8941efaf5247d40.patch
>
> I tried the patch out. Works fine on Linux. Thanks.
>
> There is a minor typo in your commit message.
>
> > Sugestted-by: Birger Skogeng Pedersen <birger.sp@gmail.com>
>
> s/Sugestted/Suggested/
>
> > Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
>
> One more observation:
>
> If I write a particularly long line (and consequently the scrollbar
> becomes active), and then hit Ctrl+A to select all text, and then
> backspace to delete it all, the scrollbar does not get updated. It still
> shows the old position where is is "scrolled" halfway through. As soon
> as I type in any other character, it takes the correct state, and
> becomes disabled.
>
> The vertical scrollbar behaves correctly in this scenario, and does take
> the correct state and position as soon as I delete all text, so I
> suspect it should be a small fix. Maybe a missed option or something
> like that?

While I can reproduce this, I don't figured out what is wrong here. I tried a minimal example and this also fails. The yScrollCommand is issued, but the xScrollCommand not. I have tcl/tk 8.6.8 on Linux.

Bert
>
> --
> Regards,
> Pratyush Yadav
Pratyush Yadav· Sep 4, 2019, 22:35 UTC · re: Bert Wesarg · lore

Re: git-gui: Long lines in commit message gets hidden, no scrollbar appears

On 04/09/19 09:39PM, Bert Wesarg wrote:
> On Tue, Sep 3, 2019 at 7:15 PM Pratyush Yadav <me@yadavpratyush.com> wrote:
> >
> > On 02/09/19 09:13PM, Bert Wesarg wrote:
[snip]
Show 18 quoted lines
> >
> > One more observation:
> >
> > If I write a particularly long line (and consequently the scrollbar
> > becomes active), and then hit Ctrl+A to select all text, and then
> > backspace to delete it all, the scrollbar does not get updated. It still
> > shows the old position where is is "scrolled" halfway through. As soon
> > as I type in any other character, it takes the correct state, and
> > becomes disabled.
> >
> > The vertical scrollbar behaves correctly in this scenario, and does take
> > the correct state and position as soon as I delete all text, so I
> > suspect it should be a small fix. Maybe a missed option or something
> > like that?
> 
> While I can reproduce this, I don't figured out what is wrong here. I
> tried a minimal example and this also fails. The yScrollCommand is
> issued, but the xScrollCommand not. I have tcl/tk 8.6.8 on Linux.

Well, I don't think this is a big enough problem to block this patch, but still something that should ideally be fixed.

I have a really busy week/weekend coming up, so I won't really be able to devote much time to this. I'll see if I can figure something out after that. I'll wait for some comments on your patches, and then get around to reading them myself when I get some more time. Thanks.

-- 
Regards,
Pratyush Yadav
Birger Skogeng Pedersen· Sep 4, 2019, 05:42 UTC · re: Pratyush Yadav · lore

Re: git-gui: Long lines in commit message gets hidden, no scrollbar appears

Hi Pratyush,
Just wanted to chime in on this one:
On Mon, Sep 2, 2019 at 8:58 PM Pratyush Yadav <me@yadavpratyush.com> wrote:
Show 5 quoted lines
> On second thought, wouldn't it make more sense to expand the commit
> message buffer instead? The point of resizing that pane is to see more
> of the commit message. So it makes more sense to make the commit message
> buffer take up all the vertical space, rather than making the scrollbar
> move.

I also think it makes sense to expand the commit message buffer. And how about automatic word wrapping? Should the user really have to care about the 72 character limit, while typing the commit message? I'm not sure what solution would be best.

Birger
Pratyush Yadav· Sep 4, 2019, 14:04 UTC · re: Birger Skogeng Pedersen · lore

Re: git-gui: Long lines in commit message gets hidden, no scrollbar appears

On 04/09/19 07:42AM, Birger Skogeng Pedersen wrote:
Show 13 quoted lines
> Hi Pratyush,
> 
> 
> Just wanted to chime in on this one:
> 
> On Mon, Sep 2, 2019 at 8:58 PM Pratyush Yadav <me@yadavpratyush.com> wrote:
> > On second thought, wouldn't it make more sense to expand the commit
> > message buffer instead? The point of resizing that pane is to see more
> > of the commit message. So it makes more sense to make the commit message
> > buffer take up all the vertical space, rather than making the scrollbar
> > move.
> 
> I also think it makes sense to expand the commit message buffer. And
Yes, it was actually a bug. Bert fixed it in his re-roll.
> how about automatic word wrapping? Should the user really have to care
> about the 72 character limit, while typing the commit message? I'm not
> sure what solution would be best.

Yes, that would be a neat feature. Tcl/Tk's text boxes have a "word wrap" feature [0], but I'm not sure if that's a soft-wrap or a hard-wrap. We can try experimenting with those to see how well it works. It would also be a good idea to have an option to disable the word wrap. Maybe do that by setting the "Commit message text width" to 0.

[0] https://www.tcl.tk/man/tcl8.4/TkCmd/text.htm#M16
-- 
Regards,
Pratyush Yadav
Junio C Hamano· Sep 2, 2019, 17:35 UTC · re: Bert Wesarg · lore

Re: git-gui: Long lines in commit message gets hidden, no scrollbar appears

Bert Wesarg <bert.wesarg@googlemail.com> writes:
> the old reasoning was, that you should not create commit messages
> which are too wide.

True, and that reasoning would justify hiding scrollbar when not necessary to gain vertical space. Can we arrange the scrollbar to appear only when needed?

Bert Wesarg· Sep 2, 2019, 17:58 UTC · re: Junio C Hamano · lore

Re: git-gui: Long lines in commit message gets hidden, no scrollbar appears

On Mon, Sep 2, 2019 at 7:35 PM Junio C Hamano <gitster@pobox.com> wrote:
Show 9 quoted lines
>
> Bert Wesarg <bert.wesarg@googlemail.com> writes:
>
> > the old reasoning was, that you should not create commit messages
> > which are too wide.
>
> True, and that reasoning would justify hiding scrollbar when not
> necessary to gain vertical space.  Can we arrange the scrollbar to
> appear only when needed?

up to now, git-gui does not hide any scrollbars, if they are not needed. IMHO, I would keep it that way, as I don't like the flicker when it appears and disappears. Imagine you are typing in the bottom line and than you typed too much. The scrollbar appears, your input line jumps one up line (or is hidden behind the scrollbar), than you remove the too long line, the scrollbar disappears again and your input line jumps down again.

Bert
Birger Skogeng Pedersen· Sep 2, 2019, 18:51 UTC · re: Bert Wesarg · lore

Re: git-gui: Long lines in commit message gets hidden, no scrollbar appears

On Mon, Sep 2, 2019 at 7:58 PM Bert Wesarg <bert.wesarg@googlemail.com> wrote:
Show 9 quoted lines
> up to now, git-gui does not hide any scrollbars, if they are not
> needed. IMHO, I would keep it that way, as I don't like the flicker
> when it appears and disappears. Imagine you are typing in the bottom
> line and than you typed too much. The scrollbar appears, your input
> line jumps one up line (or is hidden behind the scrollbar), than you
> remove the too long line, the scrollbar disappears again and your
> input line jumps down again.
>
> Bert

FWIW I strongly agree with this. Invisible scrollbars that pop up (like you describe) are often quite annoying. I much prefer to just keep them visible all the time, and disabled when there is nothing to scroll.

Birger

← back to recent threads