git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 1/2] git-gui: warn if the commit message contains lines longer than the set limit

From
Bert Wesarg <bert.wesarg@googlemail.com>
Date
Sep 4, 2019, 20:43 UTC
Message-ID
<CAKPyHN3=hh7DCoyEKB9DOf=t=v=Y1bX1xVx9r6Lxy=WQb9JC-A@mail.gmail.com>
In-Reply-To
<CAPig+cSL0fpc5cVgO1soAksD2b5xadkDLG+JxiDCi5s95VRU_A@mail.gmail.com>
On Wed, Sep 4, 2019 at 10:30 PM Eric Sunshine <sunshine@sunshineco.com> wrote:
Show 5 quoted lines
>
> On Wed, Sep 4, 2019 at 4:10 PM Bert Wesarg <bert.wesarg@googlemail.com> wrote:
> > The commit message widget does not wrap the next and has a configurable
>
> s/next/text/
fixed
Show 11 quoted lines
>
> > fixed width to avoid creating too wide commit messages. Though this was
> > only enforced in the GUI. Now we also check the commit message at commit
> > time for long lines and ask the author for confirmation if it exceeds the
> > configured line length.
>
> Hmm, more confirmation dialogs tend to mean more annoyance for users,
> especially considering that the line length limit is a
> project-specific _policy_ (so this has the potential to annoy a lot of
> people), and also because there often are legitimate reasons for
> exceeding the limit (such as pasting in URLs).

these people did not saw the entered text anyway. they would have needed to change the option (default to 75 characters) to see what they have typed. which could have been garbage to begin with.

Show 6 quoted lines
>
> As an alternative to a confirmation dialog, how about instead adding a
> _warning_ message (perhaps with red text) on the window itself
> alongside to the commit message field (below or above it or
> something)? Is that something that could be triggered by a text widget
> callback?

How about a horizontal scrollbar? This indicates pretty conveniently and in a standard visual way, that there is more text to the side ;-)

Show 8 quoted lines
>
> > Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
> > ---
> > diff --git a/lib/commit.tcl b/lib/commit.tcl
> > @@ -215,6 +215,16 @@ A good commit message has the following format:
> > +       if {[tcl::mathfunc::max {*}[lmap x [split $msg "\n"] {string length $x}]] >= $repo_config(gui.commitmsgwidth) \
>
> Does this take TABs into account?
probably not. Does git expands tabs if it wrap lines (git shortlog's -w option)?
Previous: Eric SunshineNext: Pratyush Yadav
Message 8 of 21 in “git-gui: warn if the commit message contains lines longer than the set limit”
  1. 1/2 git-gui: warn if the commit message contains lines longer than the set limitBert Wesarg, Sep 4, 2019
  2. 2/2 git-gui: add horizontal scrollbar to commit bufferBert Wesarg, Sep 4, 2019
  3. Eric SunshineSep 4, 2019
  4. Bert WesargSep 4, 2019
  5. Pratyush YadavSep 10, 2019
  6. Bert WesargSep 12, 2019
  7. Eric SunshineSep 4, 2019
  8. Bert WesargSep 4, 2019
  9. Pratyush YadavSep 4, 2019
  10. Birger Skogeng PedersenSep 5, 2019
  11. Bert WesargSep 5, 2019
  12. Birger Skogeng PedersenSep 6, 2019
  13. Philip OakleySep 6, 2019
  14. David AguilarSep 10, 2019
  15. Pratyush YadavSep 10, 2019
  16. Johannes SixtSep 5, 2019
  17. Bert WesargSep 5, 2019
  18. Johannes SixtSep 10, 2019
  19. Bert WesargSep 12, 2019
  20. Pratyush YadavSep 10, 2019
  21. Bert WesargSep 12, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.