From mboxrd@z Thu Jan 1 00:00:00 1970 From: "J. Bakshi" Subject: Re: How to force git to use authentication as author Date: Thu, 14 Jul 2011 17:08:42 +0530 Message-ID: <20110714170842.073af841@shiva.selfip.org> References: <20110714160638.065b6542@shiva.selfip.org> <20110714161838.1e30893a@shiva.selfip.org> <1310641202.18730.16.camel@bee.lab.cmartin.tk> <20110714164547.0b359e60@shiva.selfip.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: Carlos =?UTF-8?B?TWFydMOtbg==?= Nieto , =?UTF-8?B?w4Z2?= =?UTF-8?B?YXIgQXJuZmrDtnLDsA==?= Bjarmason , git@vger.kernel.org To: unlisted-recipients:; (no To-header on input) X-From: git-owner@vger.kernel.org Thu Jul 14 13:38:48 2011 Return-path: Envelope-to: gcvg-git-2@lo.gmane.org Received: from vger.kernel.org ([209.132.180.67]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QhKFi-0007HX-Es for gcvg-git-2@lo.gmane.org; Thu, 14 Jul 2011 13:38:46 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754349Ab1GNLil convert rfc822-to-quoted-printable (ORCPT ); Thu, 14 Jul 2011 07:38:41 -0400 Received: from static.206.87.46.78.clients.your-server.de ([78.46.87.206]:38691 "EHLO Kolkata.infoservices.in" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754148Ab1GNLil convert rfc822-to-8bit (ORCPT ); Thu, 14 Jul 2011 07:38:41 -0400 Received: from shiva.selfip.org (unknown [122.176.30.116]) by Kolkata.infoservices.in (Postfix) with ESMTPSA id D74632004001; Thu, 14 Jul 2011 13:38:37 +0200 (CEST) In-Reply-To: <20110714164547.0b359e60@shiva.selfip.org> X-Mailer: Claws Mail 3.7.9 (GTK+ 2.24.4; x86_64-pc-linux-gnu) Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Archived-At: On Thu, 14 Jul 2011 16:45:47 +0530 "J. Bakshi" wrote: > On Thu, 14 Jul 2011 13:00:02 +0200 > Carlos Mart=C3=ADn Nieto wrote: >=20 > > On Thu, 2011-07-14 at 16:18 +0530, J. Bakshi wrote: > > > On Thu, 14 Jul 2011 12:38:59 +0200 > > > =C3=86var Arnfj=C3=B6r=C3=B0 Bjarmason wrote: > > >=20 > > > > On Thu, Jul 14, 2011 at 12:36, J. Bakshi > > > wrote: > > > >=20 > > > > > How can I force git to use the username as define > > > at /home/git/PASSWD as the author name for git commit ? > > > >=20 > > > > Edit the global bashrc to have: > > > >=20 > > > > export GIT_AUTHOR_NAME=3D$(cat ~/PASSWD) > > > >=20 > > > > ? > > >=20 > > > Thanks.=20 > > >=20 > > > [1] will it work with file generated by htpasswd ? as that file i= s > > > actually created by same (/home/git/PASSWD) > >=20 > > Not directly, if it only has one line, then $(cat ~/PASSWD | cut -d= ':' > > -f 1) should work, but I haven't tested it. > >=20 > > >=20 > > > [2] And the commit is over http, So is it effective to set the va= lue > > > by .bashrc ? > >=20 > > You are misunderstanding either how git works or the nomenclature. = The > > commits all happen locally and need no authentication whatsoever (a= nd > > 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 ce= ntral > > repo, for example). This is where the ~/.netrc file comes into play= , as > > I mentioned in the reply to your other mail. > >=20 > Exactly, when we need to push we are asked about authentication. I li= ke to configure the central git server in a way so that the user-name a= s in authentication, be set as author name by the git server itself. ac= tually it is how I configured svn server over http. So comparing to tha= t I am trying to achieve the same. Say your user-name is there at htpas= swd file as Carlos, so when you authenticate by Carlos to push , the au= thor-name will automatically become as Carlos. No way to customize that= with specific username. That's the idea. >=20 > Thanks >=20 =46ollowing the link below, it seems not possible right now http://permalink.gmane.org/gmane.comp.version-control.git/171444