Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
    • Switch to GitLab Next
  • Sign in / Register
TortoiseGit
TortoiseGit
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 302
    • Issues 302
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 9
    • Merge requests 9
  • Requirements
    • Requirements
    • List
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Analytics
    • Analytics
    • CI/CD
    • Code Review
    • Insights
    • Issue
    • Repository
    • Value Stream
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • TortoiseGit
  • TortoiseGitTortoiseGit
  • Issues
  • #2662

Closed
Open
Created Nov 29, 2015 by Tao Yue@taoyue

Border line in commit text boxes is shown 2 characters past the specified width

What steps will reproduce the problem?

  1. Open up TortoiseGit - Settings.
  2. Under "General", select "Dialogs 3".
  3. Set "Char position where to show a border line in commit text boxes" to 72.
  4. Open up TortoiseGit - Commit.
  5. Type 74 characters in a repeating pattern, e.g. "123456789 " (note space at end)

What is the expected output? What do you see instead?

There should be a border line after 72 characters. However, the border line is shown after 74 characters instead.

Please see attached screenshot.

What version of TortoiseGit and Git are you using? On what operating system?

  • TortoiseGit 1.8.16.0
  • git version 2.6.2.windows.1
  • Windows 10 64-bit, also repros in Windows 7 64-bit

Please provide any additional information below.

This problem appears to be caused by revision 6d2f0ce5 (17-Nov-2012) for issue #1252 (closed).

In src/TortoiseProc/ProjectProperties.cpp, the code is intentionally adding 2:

nLogWidthMarker = _ttoi(val) + 2; // HACK, + 2 needed 

The hack seems to be an attempt to work around a bug in automatic word-wrapping. You can see this by going back to a version of TortoiseGit from a year ago:

  1. Install TortoiseGit 1.8.12.0 in a VM.
  2. Set border to display at 72 characters.
  3. Open TortoiseGit - Commit.
  4. Enter 7 repetitions of "123456789 "
  5. Type "x yz"
  6. Notice that all of "x yz" gets moved to the next line. So it ends up wrapping after 70 characters instead of 72, even though it's displaying the line after 74 characters. The +2 didn't actually change the 70-character wrapping to 72.

Automatic word-wrapping is now off in TortoiseGit 1.8.16.0. I actually think this is better. If auto-wrapping is so buggy that it's not wrapping consistently, then it's better to display the border line and let the user wrap the commit message manually.

However, the hack is causing the border to be drawn in the wrong place. If the user wraps manually using the border as a guide, he now ends up with 2 extra characters.

VirtualBox_Windows_7_x64_28_11_2015_15_14_08

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking