Re: [PATCH 12/16] git-submodule: avoid sed input with no newline

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jeff King <peff@xxxxxxxx> writes:

> Some versions of sed don't like this, and give no output at
> all. Instead, we can use git-config to pare down the matches
> for us.

Good use of --literal.

But doesn't this make you wonder if "--literal-match --get-regexp" is
quite a strange combination?  "Literal" covers the value part but the key
is still regexp (and we do want it to behave that way).  However, maybe we
would want to also allow "give entries whose key is this literal key and
whose value matches this regexp"?

> +	name=$(git config --literal-match -f .gitmodules \
> +		--get-regexp 'submodule\..*\.path$' "$1" |
> +		sed -e 's/submodule\.//' -e 's/\.path.*//')
> +	test -z "$name" &&
> +	die "No submodule mapping found in .gitmodules for path '$path'"
> +	echo "$name"
>  }
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux