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

Re: [PATCH] Trim hint printed when gecos is empty.

From
Shawn Pearce <spearce@spearce.org>
Date
Nov 28, 2006, 15:31 UTC
Message-ID
<20061128153144.GB28337@spearce.org>
In-Reply-To
<200611281506.53518.andyparkins@gmail.com>
Andy Parkins <andyparkins@gmail.com> wrote:
Show 14 quoted lines
> > So I will never need something like you suggest. Having said that, if you
> > think it is best for you to mark every commit as signed-off-by you, just
> > add an alias:
> >
> > 	git repo-config --global alias.c "commit -s"
> 
> That requires that I introduce a new command; I want the existing command to 
> do The Right Thing.  Also; I certainly wouldn't want it global, as I said in 
> my original message - this is a per-project choice.  Some projects don't have 
> Signed-Off lines, so there is no point there.
> 
> Ideally, I'd be able to do
>         git repo-config alias.commit "commit -s"
> Just as I can with shell commands.

Long ago we decided that aliasing over shipped commands was a baaaad idea, as it might get a shell script into trouble when all of a sudden the "-s" option is being given to every commit invocation.

But you can install a commit-msg hook (.git/hooks/commit-msg) in any project you want to ensure a Signed-off-by line is in the commit message for. Its handed the COMMIT_EDITMSG file, which is what the message will be generated from. Looking at the code for git-commit.sh its perfectly OK if the hook edits the file too.

Further the hook could be interactive, prompting the user "are you sure you don't want to sign this commit?" or can be skipped by handing --no-verify to commit.

I just learned about commit-msg hook the other day when I was reading through git-commit.sh and noticed I didn't implement invoking that particular hook in git-gui...

Previous: Andy ParkinsNext: Junio C Hamano
Message 9 of 11 in “Trim hint printed when gecos is empty.”
  1. Trim hint printed when gecos is empty.Han-Wen Nienhuys, Nov 28, 2006
  2. Han-Wen NienhuysNov 28, 2006
  3. Jakub NarebskiNov 28, 2006
  4. Andy ParkinsNov 28, 2006
  5. Johannes SchindelinNov 28, 2006
  6. Andy ParkinsNov 28, 2006
  7. Johannes SchindelinNov 28, 2006
  8. Andy ParkinsNov 28, 2006
  9. Shawn PearceNov 28, 2006
  10. Junio C HamanoNov 28, 2006
  11. Johannes SchindelinNov 29, 2006

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.