On Tue, Apr 29, 2014 at 10:39:00AM -0500, seg...@kernel.crashing.org wrote:
> > +# if this is a git tree then take name and email from the git configuration
> > +if (-d .git) {
> > +  $gitname = `git config user.name`;
> > +  chomp($gitname);
> > +  if ($gitname) {
> > +     $name = $gitname;
> > +  }
> > +
> > +  $gitaddr = `git config user.email`;
> > +  chomp($gitaddr);
> > +  if ($gitaddr) {
> > +     $addr = $gitaddr;
> > +  }
> > +}
> 
> "-d .git" is, erm, not so great.

yeah, the only reason I was willing to do it is the script already
requires being run at top level, but that annoys me too.

> How about something like

It has the same issue that it'll activate ina svn checkout if you have
git configured, but I'm not sure that's a case worth caring about.

Trev

> 
> sub get_git_config {
>   my $res = `git config --get @_`;
>   return undef if $?;
>   chomp $res;
>   return $res;
> }
> 
> 
> Segher

Attachment: signature.asc
Description: Digital signature

Reply via email to