From: Jakub Narebski <jnareb@gmail.com>
To: "Carlos Martín Nieto" <cmn@elego.de>
Cc: "J. Bakshi" <joydeep@infoservices.in>,
"Ævar Arnfjörð Bjarmason" <avarab@gmail.com>,
git@vger.kernel.org
Subject: Re: How to force git to use authentication as author
Date: Thu, 14 Jul 2011 05:44:50 -0700 (PDT) [thread overview]
Message-ID: <m3zkkh9gmq.fsf@localhost.localdomain> (raw)
In-Reply-To: <1310643482.6041.17.camel@centaur.lab.cmartin.tk>
Carlos Martín Nieto <cmn@elego.de> writes:
> That's not how it works. It may even be possible to rewrite the commits
> in the post-receive hook in a way that most stuff doesn't break
> horribly, this would be rewriting history behind the users' backs, and
> that only brings problems.
What you can do is forbid push. I think update-paranoid and gitolite
have some examples on how to do that.
> The way to set the author name and mail in a standard way, be it
> user-wide or per-repo. You can write up some simple instructions on how
> to do it.
>
> git config user.name "Max Smith"
> git config user.mail max.smith@example.com
>
> and if the config should be valid for every repo, use --global flag.
> There is more information in the manual page.
>
> You could then add a check in the post-receive hook to reject pushes
> with invalid author names, if you feel it's worth it.
>
> Taking a step back, why is this even an issue, though? If you don't
> trust your developers to set their name and email correctly, why do you
> trust them to write code? If it's company policy for people to be
> referred to by their usernames rather than their given names, why not
> tell them to set it to that[0]? It seems like you are trying to solve a
> social issue with a technological measure that works at a different
> level.
>
> [0] and given that they're probably using their company email address,
> it wouldn't be a problem to get a unique ID for each developer if that's
> what you need.
Note that there is also .mailmap mechanism (see the documentation)
which can translate on the fly between public emails and internal
company emails, and which can fix invalid names... at least got
git-log, git-blame etc.
--
Jakub Narębski
next prev parent reply other threads:[~2011-07-14 12:44 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-14 10:36 How to force git to use authentication as author J. Bakshi
2011-07-14 10:38 ` Ævar Arnfjörð Bjarmason
2011-07-14 10:48 ` J. Bakshi
2011-07-14 11:00 ` Carlos Martín Nieto
2011-07-14 11:15 ` J. Bakshi
2011-07-14 11:38 ` Carlos Martín Nieto
2011-07-14 12:00 ` Erik Faye-Lund
2011-07-14 12:19 ` J. Bakshi
2011-07-14 12:26 ` Carlos Martín Nieto
2011-07-14 12:01 ` J. Bakshi
2011-07-14 12:16 ` Ferry Huberts
2011-07-14 12:44 ` Jakub Narebski [this message]
2011-07-14 11:38 ` J. Bakshi
2011-07-14 11:53 ` Erik Faye-Lund
2011-07-14 19:45 ` Jonathan Nieder
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m3zkkh9gmq.fsf@localhost.localdomain \
--to=jnareb@gmail.com \
--cc=avarab@gmail.com \
--cc=cmn@elego.de \
--cc=git@vger.kernel.org \
--cc=joydeep@infoservices.in \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).