[PATCH] Add scripts/backport-support.sh

Mike Frysinger vapier@gentoo.org
Fri Mar 17 04:50:00 GMT 2017


On 09 Feb 2017 16:35, Florian Weimer wrote:
> +export LC_ALL=C

why ?  seems like it'll mishandle UTF8 ?

> +usage () {

we seem to be inconsistent, but i prefer no spaces before () ...

> +    cat >&2 <<EOF

style is weird.  what's with the 4 space indent ?
we use two spaces normally.

> +if test $# -ne 1 ; then

`test` instead of `[` ?

i think we normally omit the space before the ;

> +case "$command" in
> +    patch|commit)
> +    ;;
> +    *)
> +	usage
> +	;;
> +esac

now we mix tabs ?

> +# Simplify the branch name somewhat for reporting.
> +branch_name="$(echo "$branch" | sed s,^origin/,,)"

branch_name=${branch#origin/}

> +    git status --porcelain | while read line ; do

this creates a subshell.  you really want:
  while read -d $'0' -r line; do
    ...
  done < <(git status --porcelain)

should also have `local line`
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: Digital signature
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20170317/d6e72698/attachment.sig>


More information about the Libc-alpha mailing list