Andy Parkins <andyparkins@xxxxxxxxx> wrote: > > 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... -- Shawn. - To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html