Re: How to force git to use authentication as author

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 14 Jul 2011 13:00:02 +0200
Carlos Martín Nieto <cmn@xxxxxxxx> wrote:

> On Thu, 2011-07-14 at 16:18 +0530, J. Bakshi wrote:
> > On Thu, 14 Jul 2011 12:38:59 +0200
> > Ævar Arnfjörð Bjarmason <avarab@xxxxxxxxx> wrote:
> > 
> > > On Thu, Jul 14, 2011 at 12:36, J. Bakshi <joydeep@xxxxxxxxxxxxxxx>
> > wrote:
> > > 
> > > > How can I force git to use the username as define
> > at /home/git/PASSWD as the author name for git commit ?
> > > 
> > > Edit the global bashrc to have:
> > > 
> > >     export GIT_AUTHOR_NAME=$(cat ~/PASSWD)
> > > 
> > > ?
> > 
> > Thanks. 
> > 
> > [1] will it work with file generated by htpasswd ? as that file is
> > actually created by same (/home/git/PASSWD)
> 
> Not directly, if it only has one line, then $(cat ~/PASSWD | cut -d ':'
> -f 1) should work, but I haven't tested it.
> 
> > 
> > [2] And the commit is over http, So is it effective to set the value
> > by .bashrc ?
> 
> You are misunderstanding either how git works or the nomenclature. The
> commits all happen locally and need no authentication whatsoever (and
> usually you're expected to use a real name and email address). When you
> need to authenticate is when yuou push your changes somewhere (a central
> repo, for example). This is where the ~/.netrc file comes into play, as
> I mentioned in the reply to your other mail.
> 
Exactly, when we need to push we are asked about authentication. I like to configure the central git server in a way so that the user-name as in authentication, be set as author name by the git server itself. actually it is how I configured svn server over http. So comparing to that I am trying to achieve the same. Say your user-name is there at htpasswd file as Carlos, so when you authenticate by Carlos to push , the author-name will automatically become as Carlos. No way to customize that with specific username. That's the idea.

Thanks

--
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


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]