prati0100 / git-gui

Tcl/Tk based UI for Git. I am currently acting as the project's maintainer.
160 stars 87 forks source link

Git gui wrongly commits lines starting with # #51

Closed dmitry-kabanov closed 3 years ago

dmitry-kabanov commented 3 years ago

In

git-gui version 0.21.0.93.g7b0cfe1
git version 2.24.3 (Apple Git-128)

Tcl/Tk version 8.6.11

the use of the commit message template is implemented.

Expected behavior. Comment lines (starting with # symbol) are ignored.

Observed behavior. The comment lines in the commit message are included in the commit message.

dmitry-kabanov commented 3 years ago

Example. A commit message like this:

    # <type>: (If applied, this commit will...) <subject> (Max 50 char)
    # |<----  Using a Maximum Of 50 Characters  ---->|
    BUG: Accepts any iteratable and convert to ndarray

    # Explain why this change is being made
    # |<----   Try To Limit Each Line to a Maximum Of 72 Characters   ---->|

    # Provide links or keys to any relevant tickets, articles or other resources
    # Example: Github issue #23

should be committed as

    BUG: Accepts any iteratable and convert to ndarray
prati0100 commented 3 years ago

@dmitry-kabanov Should be fixed by the patch here. Also available here: https://github.com/prati0100/git-gui/tree/py/commit-comments

Please test and confirm it is working for you.

dmitry-kabanov commented 3 years ago

I have built and installed:

❯ make      
GITGUI_VERSION = 0.21.0.95.g7da7e
    * new locations or Tcl/Tk interpreter
    GEN git-gui
    GEN Git Gui.app
    GEN git-gui.tcl
    INDEX lib/
    MSGFMT    po/bg.msg 565 translated.
    MSGFMT    po/de.msg 579 translated.
    MSGFMT    po/el.msg 381 translated, 4 fuzzy, 6 untranslated.
    MSGFMT    po/fr.msg 520 translated.
    MSGFMT    po/hu.msg 514 translated.
    MSGFMT    po/it.msg 519 translated, 1 untranslated.
    MSGFMT    po/ja.msg 546 translated, 1 untranslated.
    MSGFMT    po/nb.msg 474 translated, 39 untranslated.
    MSGFMT po/pt_br.msg 520 translated.
    MSGFMT po/pt_pt.msg 550 translated.
    MSGFMT    po/ru.msg 579 translated.
    MSGFMT    po/sv.msg 547 translated.
    MSGFMT    po/vi.msg 543 translated.
    MSGFMT po/zh_cn.msg 366 translated, 7 fuzzy, 17 untranslated.

git-gui on  master on ☁️  eu-central-1 took 2s 
❯ make install
  DEST /usr/local/Cellar/git/2.30.0/libexec/git-core
    INSTALL 755 git-gui
    INSTALL 755 git-gui--askpass
    LINK        git-citool -> git-gui
  DEST /usr/local/Cellar/git/2.30.0/share/git-gui/lib
    INSTALL 644 tclIndex
    INSTALL     Git Gui.app
138 blocks
    INSTALL 755 git-gui.tcl
    INSTALL 644 about.tcl
    INSTALL 644 blame.tcl
    INSTALL 644 branch.tcl
    INSTALL 644 branch_checkout.tcl
    INSTALL 644 branch_create.tcl
    INSTALL 644 branch_delete.tcl
    INSTALL 644 branch_rename.tcl
    INSTALL 644 browser.tcl
    INSTALL 644 checkout_op.tcl
    INSTALL 644 choose_font.tcl
    INSTALL 644 choose_repository.tcl
    INSTALL 644 choose_rev.tcl
    INSTALL 644 chord.tcl
    INSTALL 644 class.tcl
    INSTALL 644 commit.tcl
    INSTALL 644 console.tcl
    INSTALL 644 database.tcl
    INSTALL 644 date.tcl
    INSTALL 644 diff.tcl
    INSTALL 644 encoding.tcl
    INSTALL 644 error.tcl
    INSTALL 644 index.tcl
    INSTALL 644 line.tcl
    INSTALL 644 logo.tcl
    INSTALL 644 merge.tcl
    INSTALL 644 mergetool.tcl
    INSTALL 644 option.tcl
    INSTALL 644 remote.tcl
    INSTALL 644 remote_add.tcl
    INSTALL 644 remote_branch_delete.tcl
    INSTALL 644 search.tcl
    INSTALL 644 shortcut.tcl
    INSTALL 644 spellcheck.tcl
    INSTALL 644 sshkey.tcl
    INSTALL 644 status_bar.tcl
    INSTALL 644 themed.tcl
    INSTALL 644 tools.tcl
    INSTALL 644 tools_dlg.tcl
    INSTALL 644 transport.tcl
    INSTALL 644 win32.tcl
    INSTALL 644 git-gui.ico
    INSTALL 644 win32_shortcut.js
  DEST /usr/local/Cellar/git/2.30.0/share/git-gui/lib/msgs
    INSTALL 644 bg.msg
    INSTALL 644 de.msg
    INSTALL 644 el.msg
    INSTALL 644 fr.msg
    INSTALL 644 hu.msg
    INSTALL 644 it.msg
    INSTALL 644 ja.msg
    INSTALL 644 nb.msg
    INSTALL 644 pt_br.msg
    INSTALL 644 pt_pt.msg
    INSTALL 644 ru.msg
    INSTALL 644 sv.msg
    INSTALL 644 vi.msg
    INSTALL 644 zh_cn.msg

When I execute git gui, it says in the "About Git Gui" in macOS git-gui version 0.21.0.95.g7da7e. I am not sure but it seems the version from the commit point from the above link?

The comment lines are still there in the git log.

prati0100 commented 3 years ago

@dmitry-kabanov you are in the branch "master". The change is not yet into master because it is going through code review. Please check out the branch py/commit-comments. This should have this bug fixed.

dmitry-kabanov commented 3 years ago

Oops, it was silly of me :-) For some reason, I have decided that the git clone will checkout the corresponding branch that was shown in the Github interface.

I confirm that in the following version

git-gui version 0.21.0.96.g2714
git version 2.30.0

Tcl/Tk version 8.5.9
Aspell 0.60.8, en_US

the commit lines starting with # character are removed from the commit message.

Thank you!

prati0100 commented 3 years ago

Fixed in https://github.com/prati0100/git-gui/commit/b1056f60b63f1bc8226d01881bc829e171fc78bf