Comments (5)
Hi, thanks for reporting. I'm not sure about the behavior here. Doesn't adding a carriage return would break the Commit message with no body? I want to keep the git commit
default behavior and I though it was to let the CR/LF to the hooks/tools?
I may be totally wrong here, in that case this should be a quick fix but I want to be sure about it first.
Whatever the decision, I will at least add an option (tug
options are managed through git) to add this CR/LF automatically since it seems to be useful to at least you.
from turbogit.
A quick test using the standard git -m
command for a "commit message with no body" including a signoff gives a blank line between the summary and body (my understanding of the git commit format - much like SMTP headers): summary, blank line, body, blank line, trailers.
/t/testing on master [+] ❯ git commit -a -m "Test" -s
[master (root-commit) d100763] Test
1 file changed, 2 insertions(+)
create mode 100644 test.txt
/t/testing on master ❯ git log
commit d10076354de294a79c2114e2a5f5aa5399aefdc5 (HEAD -> master)
Author: Mark Derricutt <[email protected]>
Date: Thu Jan 28 20:03:16 2021 +1300
Test
Signed-off-by: Mark Derricutt <[email protected]>
Interesting - reading the docs for git-interpret-trailers
at http://manpages.ubuntu.com/manpages/cosmic/man1/git-interpret-trailers.1.html :
By default the new trailer will appear at the end of all the existing trailers. If there is no existing trailer, the new trailer will appear after the commit message part of the output, and, if there is no line with only spaces at the end of the commit message part, one blank line will be added before the new trailer.
From this one could argue that it's up to the hook script from Gerrit to add that blank line - but it appears that tug's behaviour is different to git.
from turbogit.
Interesting - using tug
against most of our projects repositories - some which use a newer version of Gerrit's commit hook, I see that my Change-Id
trailers seen to get added correctly with a blank line ( the hook adds it ).
So this may not be required if I just update my hooks - tho it may be useful to have regardless.
from turbogit.
In your test you used -s
option. In my understanding the blank line is added with the -s
option, not after the subject. That can be reproduced with multiple -m
options:
➜ git commit --allow-empty -m "First line" -m "Second line" -m "Third line"
[master fa47988] First line
➜ git log
commit fa479888ea93683f35ac8e7edb2c99920c814c30 (HEAD -> master)
Author: foo <[email protected]>
Date: Sat Jan 30 11:03:27 2021 +0100
First line
Second line
Third line
But I think tug commit build -s bug-1234 Updated dependencies
should reproduce git commit --allow-empty -m "build(bug-1234): Updated dependencies"
which it actually does:
commit 6f11f475ef53347b57474abce680476780034644 (HEAD -> master) <---- turbogit
Author: foo <[email protected]>
Date: Sat Jan 30 11:11:04 2021 +0100
build(bug-1234): Updated dependencies
commit db5856c9696c224bf1ebaa507675653a413715e8 <---- git commit
Author: foo <[email protected]>
Date: Sat Jan 30 11:09:06 2021 +0100
build(bug-1234): Updated dependencies
Do you agree with that?
from turbogit.
Closing since I think it's the expected behavior.
from turbogit.
Related Issues (20)
- [FEAT] Use users instead of user for branch naming
- Update git2go dependency to version 33 HOT 1
- [BUG] Can't find tug and libgit2.so.1.3 HOT 6
- [BUG] branch name contains double quotes (")
- [BUG] turbogit build fails with libgit @1.4.2: git2go supports libgit2 between v1.3.0 and v1.3.0 HOT 1
- [BUG] Should not commit when working tree is clean
- [BUG] Website - button style on hover state HOT 4
- [BUG] Slowness issue on large repos HOT 7
- [BUG] Error: no changes added to commit when creating commit
- [FEAT] Support Git hooks
- [HELP] Windows CI build/release HOT 1
- [FEAT] Support issues/tickets linked to the feature branch HOT 1
- [FEAT] Add ability to configure valid git commit types HOT 2
- [FEAT] Add GitHub integration
- [FEAT] Add GitLab integration
- [FEAT] Add config rule command
- Dependabot can't resolve your Go dependency files
- [BUG] HOT 2
- [BUG] Trying to create a branch result in invalid reference
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from turbogit.