Ben Walton wrote: > Excerpts from Jeff King's message of Fri Jun 12 10:48:57 -0400 2009: >> [any reason not to keep this on the git list?] > > ...no, I just forget to set the CC. > >> On Fri, Jun 12, 2009 at 10:36:46AM -0400, Ben Walton wrote: >> >>> I've aliased 'ci' to 'commit -s', and people either use the alias or >>> are encouraged to add the -s (it is by convention only, after all). >>> We've then setup the root shell such that $USER is leveraged to source >>> in some personalized shell when su is used. This is where we set >>> GIT_COMMITTER_* on a per-admin basis. People not doing that edit the >>> SoB line while editing the commit message...this fails with 'ci -m'. >> Makes sense. I have a similar setup where people could be identified by >> the ssh keys they use to log in, but I have never gotten around to >> setting up something automated. >> >> I suspect SoB may be more convenient than GIT_AUTHOR_* in your scenario >> just because you can tweak the former in the editor, as you note (and it >> sounds like it's possible to not have the other variables set up >> properly in your setup). > > It is easier from that perspective, but since nothing is forcing the > use of -s, we'd have the same compliance if we wanted to ask people to > use --author (or set the proper environment). > >>> Actually, I'm still wavering on which I'd prefer. At this point, >>> since git is still fairly new for us in this capacity, we're feeling >>> our way through things. I went with COMMITTER instead of AUTHOR >>> though since that tends to stand out more in `git log` (at least to my >>> eyes). Since we're not a finger pointing group :), things like `git >> I would argue that you should do the opposite. AUTHOR is really about >> "who wrote this change" and COMMITTER is about "who put this change into >> the repo". So to me, "Bob wrote the change, logged in as root@box2, and >> committed" should be AUTHOR=Bob, COMMITTER=root@box2. > > Your described usage is more semantically correct. It may make sense > for us to switch to AUTHOR, so that in the future we could pinpoint > changes with less hassle. I'll be discussing this with my colleagues > shortly. We use a shared account for updating a specific git repository. I have this bit of shell in the .bash_profile of that account to automatically prompt and set GIT_AUTHOR_NAME and GIT_AUTHOR_EMAIL when someone tries "git commit': _setup_git_ident () { local userid local ypentry while read -p "Your Real Login ID (not \"$LOGNAME\")> " userid do ypentry=$(ypmatch "$userid" passwd) || continue break done oldIFS=$IFS IFS=: set -- $ypentry IFS=$oldIFS GIT_AUTHOR_NAME=${GIT_AUTHOR_NAME:-"$5"} GIT_AUTHOR_EMAIL=${GIT_AUTHOR_EMAIL:-"$1@"$(dnsdomainname)} export GIT_AUTHOR_NAME GIT_AUTHOR_EMAIL } _run_git () { if [ "x$1" = "xcommit" ] && [ -z "$GIT_AUTHOR_NAME" -o -z "$GIT_AUTHOR_EMAIL" ] then _setup_git_ident fi git "$@" } alias git=_run_git -- 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