list mirror (unofficial, one of many)
 help / color / Atom feed
From: René Scharfe <>
To: Stefan Beller <>
Cc: Eric Sunshine <>,
	Git List <>,
	Junio C Hamano <>,, Prathamesh Chavan <>
Subject: Re: [PATCH] submodule: check for NULL return of get_submodule_ref_store()
Date: Thu, 29 Mar 2018 00:24:49 +0200
Message-ID: <> (raw)
In-Reply-To: <>

Am 28.03.2018 um 23:37 schrieb Stefan Beller:
>> This looks nicer here in the script, but doesn't test exactly what users
>> type most of the time, I suppose.
>> So how about this?
> Looks good to me, though I had a nagging feeling at first that the
> regex could be made more concise.
> Why do we need the optional "[^ ]" inside \1 ?
>> +       sed -e "s/^ \([^ ]* repo\) .*/-\1/" <actual >expect &&

[:xdigit:] would match the hash more precisely, but I don't know how
widely this character class is supported among sed implementations.
And being so strict may require changes once SHA1 is replaced -- new
hashes might be marked with a special character.  And it's longer

\S could be used instead, but I also don't know how widely this is

. could be used as well, of course, but that feels a bit sloppy to

Using separate s commands for beginning and end of the line would
be shorter.  This here is slightly longer, anyway:

	/ repo / {s/^ /-/; s/ (.*//}

What do you have in mind?  How to transform this:

 b2613938d15a18d9d4a504cacd9654fd1c879197 repo (heads/master)

... into this:

-b2613938d15a18d9d4a504cacd9654fd1c879197 repo

... while keeping other lines unchanged?


  reply index

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-25  9:50 Null pointer dereference in git-submodule Jeremy Feusi
2018-03-25 10:57 ` René Scharfe
2018-03-27 23:50   ` Stefan Beller
2018-03-28 16:52     ` Junio C Hamano
2018-03-28 17:03       ` Stefan Beller
2018-03-28 18:38   ` [PATCH] submodule: check for NULL return of get_submodule_ref_store() Stefan Beller
2018-03-28 18:57     ` Eric Sunshine
2018-03-28 20:08       ` Stefan Beller
2018-03-28 20:21         ` Eric Sunshine
2018-03-28 20:54           ` Stefan Beller
2018-03-28 21:14           ` René Scharfe
2018-03-28 21:37             ` Stefan Beller
2018-03-28 22:24               ` René Scharfe [this message]
2018-03-28 22:35               ` Junio C Hamano

Reply instructions:

You may reply publically to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

  List information:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link list mirror (unofficial, one of many)

Archives are clonable:
	git clone --mirror
	git clone --mirror http://ou63pmih66umazou.onion/git
	git clone --mirror http://czquwvybam4bgbro.onion/git
	git clone --mirror http://hjrcffqmbrq6wope.onion/git

Newsgroups are available over NNTP:

 note: .onion URLs require Tor:
       or Tor2web:

AGPL code for this site: git clone public-inbox