ungit icon indicating copy to clipboard operation
ungit copied to clipboard

How to use git commit -s with Ungit?

Open chintan-mishra opened this issue 3 years ago • 1 comments

When contributing to a repo that enforces DCO then I have to switch to CLI for committing the changes, as Ungit cannot auto-fill the Sign-Off block in the commit message

This might be happening due to alias section in ~/.gitconfig file not getting recognized/parsed. Read more below.

I used this resource to set up git for contributing to repos with DCO.

However, when committing using Ungit, it is expected that the following block will be included

Sgned-off by: FirstName LastName <[email protected]>

But that is not the case. Sign-off doesn't get included.

So, I switched to CLI to test if git is honoring the ~/.gitconfig at all. Here is what I did.

$ git add .
$ git commit

Commits using CLI had the Sign-Off block in the commit message.

How to set up git and Ungit to automatically contain Sign-off block while committing?

chintan-mishra avatar May 24 '21 10:05 chintan-mishra

Here is the concerned output log obtained from ungit --logGitCommands

{"message":"git result (first 400 bytes): -c color.ui=false -c core.quotepath=false -c core.pager=cat -c core.editor=: log --cc --decorate=full --show-signature --date=default --pretty=fuller -z --branches --tags --remotes --parents --no-notes --numstat --date-order --max-count=100 --skip=0\n\ncommit c97fb2bb852af4b37fb0c811a3e59ff101265822 d8c6f414ac09f19e237139f71aef3235ae7699b7 (HEAD -> refs/heads/master)\nAuthor:     Chintan \"greenz1\" Mishra <[email protected]>\nAuthorDate: Mon May 24 16:13:35 2021 +0530\nCommit:     Chintan \"greenz1\" Mishra <[email protected]>\nCommitDate: Mon May 24 16:13:35 2021 +0530\n\n    Commit 2\n\n0\t0\ttemp1\u0000\u0000commit d8c6f414ac09f19e237139f71aef3235ae7699b7\nAuthor:  ","level":"info","timestamp":"2021-05-24T10:43:36.409Z"}

chintan-mishra avatar May 24 '21 10:05 chintan-mishra