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 16:45:47 +0530 Message-ID: <20110714164547.0b359e60@shiva.selfip.org> References: <20110714160638.065b6542@shiva.selfip.org> <20110714161838.1e30893a@shiva.selfip.org> <1310641202.18730.16.camel@bee.lab.cmartin.tk> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: =?UTF-8?B?w4Z2YXIgQXJuZmrDtnLDsA==?= Bjarmason , git@vger.kernel.org To: Carlos =?UTF-8?B?TWFydMOtbg==?= Nieto X-From: git-owner@vger.kernel.org Thu Jul 14 13:15:53 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 1QhJtW-0004K5-TO for gcvg-git-2@lo.gmane.org; Thu, 14 Jul 2011 13:15:51 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754485Ab1GNLPq convert rfc822-to-quoted-printable (ORCPT ); Thu, 14 Jul 2011 07:15:46 -0400 Received: from static.206.87.46.78.clients.your-server.de ([78.46.87.206]:52920 "EHLO Kolkata.infoservices.in" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754429Ab1GNLPp convert rfc822-to-8bit (ORCPT ); Thu, 14 Jul 2011 07:15:45 -0400 Received: from shiva.selfip.org (unknown [122.176.30.116]) by Kolkata.infoservices.in (Postfix) with ESMTPSA id C35452004002; Thu, 14 Jul 2011 13:15:41 +0200 (CEST) In-Reply-To: <1310641202.18730.16.camel@bee.lab.cmartin.tk> 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 13:00:02 +0200 Carlos Mart=C3=ADn Nieto wrote: > 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 is > > 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 valu= e > > by .bashrc ? >=20 > You are misunderstanding either how git works or the nomenclature. Th= e > commits all happen locally and need no authentication whatsoever (and > usually you're expected to use a real name and email address). When y= ou > need to authenticate is when yuou push your changes somewhere (a cent= ral > 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 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. actu= ally 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 htpassw= d file as Carlos, so when you authenticate by Carlos to push , the auth= or-name will automatically become as Carlos. No way to customize that w= ith specific username. That's the idea. Thanks