Re: [PATCH 1/2] teach mklog to get name / email from git config when available

2014-11-25 Thread Diego Novillo
On 20/11/2014, 16:51 , Tom de Vries wrote: OK for trunk? This is fine. Thanks. Diego.

Re: [PATCH 1/2] teach mklog to get name / email from git config when available

2014-11-20 Thread Tom de Vries
On 20-11-14 17:43, Segher Boessenkool wrote: On Thu, Nov 20, 2014 at 05:22:20PM +0100, Tom de Vries wrote: +my $conf = "$ENV{HOME}/.mklog"; +if (-f "$conf") { +open (CONF, "$conf") + or die "Could not open file '$conf' for reading: $!\n"; +while () { + if (m/^\s*NAME\s*=\s*(.

Re: [PATCH 1/2] teach mklog to get name / email from git config when available

2014-11-20 Thread Segher Boessenkool
On Thu, Nov 20, 2014 at 05:22:20PM +0100, Tom de Vries wrote: > +my $conf = "$ENV{HOME}/.mklog"; > +if (-f "$conf") { > +open (CONF, "$conf") > + or die "Could not open file '$conf' for reading: $!\n"; > +while () { > + if (m/^\s*NAME\s*=\s*(.*)\s*$/) { The final \s* never matches

Re: [PATCH 1/2] teach mklog to get name / email from git config when available

2014-11-20 Thread Tom de Vries
On 09-05-14 16:47, Diego Novillo wrote: I would probably use git config directly here. It would work with both git and svn checkouts (if you have a global .git configuration). But testing for .git is fine with me as well. I like Peter's idea of having a ~/.mklog file to override. This would work

Re: [PATCH 1/2] teach mklog to get name / email from git config when available

2014-05-09 Thread Diego Novillo
On Mon, Apr 28, 2014 at 10:11 PM, wrote: > 2014-04-28 Trevor Saunders > > * mklog: if in a git checkout try to get name and email from git. > --- > contrib/mklog | 14 ++ > 1 file changed, 14 insertions(+) > > diff --git a/contrib/mklog b/contrib/mklog > index fb489b0..5f5

Re: [PATCH 1/2] teach mklog to get name / email from git config when available

2014-04-29 Thread Segher Boessenkool
> > > +if (-d .git) { > > "-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. That, but also it is equivalent to if ((-d $_)."git") { which is probably not what you wanted ;-) "use w

Re: [PATCH 1/2] teach mklog to get name / email from git config when available

2014-04-29 Thread Peter Bergner
On Tue, 2014-04-29 at 10:39 -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; > > + } > >

Re: [PATCH 1/2] teach mklog to get name / email from git config when available

2014-04-29 Thread Trevor Saunders
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; > > +

Re: [PATCH 1/2] teach mklog to get name / email from git config when available

2014-04-29 Thread segher
> +# 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

Re: [PATCH 1/2] teach mklog to get name / email from git config when available

2014-04-29 Thread Yury Gribov
On 04/29/2014 02:06 PM, Trevor Saunders wrote: +if (-d .git) { What about moving default name/addr (with finger, etc.) to else branch? Well, consider the case git doesn't know I wonder whether it's ok to force user to configure git before running mklog... -Y

Re: [PATCH 1/2] teach mklog to get name / email from git config when available

2014-04-29 Thread Trevor Saunders
On Tue, Apr 29, 2014 at 09:08:50AM +0400, Yury Gribov wrote: > Hi Trevor, > > I think this looks rather useful. sounds great! > > +if (-d .git) { > > What about moving default name/addr (with finger, etc.) to else branch? Well, consider the case git doesn't know, that said I could do if (-d .

Re: [PATCH 1/2] teach mklog to get name / email from git config when available

2014-04-28 Thread Yury Gribov
Hi Trevor, I think this looks rather useful. > +if (-d .git) { What about moving default name/addr (with finger, etc.) to else branch? > + chomp($gitname); > + chomp($gitaddr); Missing whites before (. -Y