lkml.org 
[lkml]   [2019]   [Sep]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] checkpatch: Remove obsolete period from "ambiguous SHA1" query
On Fri, Aug 30, 2019 at 11:01:29AM -0700, Joe Perches wrote:
> On Fri, 2019-08-30 at 10:17 -0700, Sean Christopherson wrote:
> > On Fri, Aug 30, 2019 at 09:37:51AM -0700, Joe Perches wrote:
> > > On Fri, 2019-08-30 at 09:31 -0700, Sean Christopherson wrote:
> > > > Git dropped the period from its "ambiguous SHA1" error message in commit
> > > > 0c99171ad2 ("get_short_sha1: mark ambiguity error for translation"),
> > > > circa 2016. Drop the period from checkpatch's associated query so as to
> > > > match both the old and new error messages.
> > > >
> > > > Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
> > > > ---
> > > > scripts/checkpatch.pl | 2 +-
> > > > 1 file changed, 1 insertion(+), 1 deletion(-)
> > > >
> > > > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> > > > index 93a7edfe0f05..ef3642c53100 100755
> > > > --- a/scripts/checkpatch.pl
> > > > +++ b/scripts/checkpatch.pl
> > > > @@ -962,7 +962,7 @@ sub git_commit_info {
> > > >
> > > > return ($id, $desc) if ($#lines < 0);
> > > >
> > > > - if ($lines[0] =~ /^error: short SHA1 $commit is ambiguous\./) {
> > > > + if ($lines[0] =~ /^error: short SHA1 $commit is ambiguous/) {
> > > > # Maybe one day convert this block of bash into something that returns
> > > > # all matching commit ids, but it's very slow...
> > > > #
> > >
> > > Thanks.
> > >
> > > Did git ever change to actually support human readable
> > > messages in multiple languages?
> >
> > Yep, e.g.:
> >
> > error: Kurzer SHA-1 745f ist mehrdeutig.
> >
> > > If so, this won't work for non-english output.
> >
> > Yep again. The next check for 'fatal: ambiguous argument' obviously fails
> > as well and checkpatch ends up using git's error message as the id and
> > description.
> >
> > ERROR: Please use git ... - ie: 'commit error: Kurze ("")'
>
> Does git exit with unique failure codes?

Nope, AFAICT usage errors get exit(129) and everything else gets exit(128).

> If so, maybe the waitid/siginfo_t error could be used instead.

\
 
 \ /
  Last update: 2019-09-03 18:09    [W:0.063 / U:0.348 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site