From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carlos =?ISO-8859-1?Q?Mart=EDn?= Nieto Subject: Re: How to force git to use authentication as author Date: Thu, 14 Jul 2011 13:00:02 +0200 Message-ID: <1310641202.18730.16.camel@bee.lab.cmartin.tk> References: <20110714160638.065b6542@shiva.selfip.org> <20110714161838.1e30893a@shiva.selfip.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: =?ISO-8859-1?Q?=C6var_Arnfj=F6r=F0?= Bjarmason , git@vger.kernel.org To: "J. Bakshi" X-From: git-owner@vger.kernel.org Thu Jul 14 13:00:21 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 1QhJeS-0004to-Nb for gcvg-git-2@lo.gmane.org; Thu, 14 Jul 2011 13:00:17 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754415Ab1GNLAM convert rfc822-to-quoted-printable (ORCPT ); Thu, 14 Jul 2011 07:00:12 -0400 Received: from kimmy.cmartin.tk ([91.121.65.165]:60172 "EHLO kimmy.cmartin.tk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754151Ab1GNLAJ (ORCPT ); Thu, 14 Jul 2011 07:00:09 -0400 Received: from [192.168.1.22] (brln-d9ba36b2.pool.mediaWays.net [217.186.54.178]) by kimmy.cmartin.tk (Postfix) with ESMTPSA id D464D461FA; Thu, 14 Jul 2011 12:59:28 +0200 (CEST) In-Reply-To: <20110714161838.1e30893a@shiva.selfip.org> X-Mailer: Evolution 2.32.3 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Archived-At: 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) Not directly, if it only has one line, then $(cat ~/PASSWD | cut -d ':' -f 1) should work, but I haven't tested it. >=20 > [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 centra= l repo, for example). This is where the ~/.netrc file comes into play, as I mentioned in the reply to your other mail. Cheers, cmn