Re: [PATCH 2/2] rebase -i: Preserve whitespace at beginning of commit header in $GIT_EDITOR

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

 



Nazri Ramliy <ayiehere@xxxxxxxxx> writes:

> diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh
> index 31e6860..726cb6a 100755
> --- a/git-rebase--interactive.sh
> +++ b/git-rebase--interactive.sh
> @@ -889,14 +889,15 @@ first and then run 'git rebase --continue' again."
>  		fi
>  		git rev-list $MERGES_OPTION --pretty=oneline --abbrev-commit \
>  			--abbrev=7 --reverse --left-right --topo-order \
> +			$REVISIONS | sed -n "s/^>//p" > "$TODO.tmp"
> +
> +		if test t != "$PRESERVE_MERGES"
> +		then
> +			cat "$TODO.tmp" | sed "s/^/pick /" > "$TODO"

Do not cat a single file into a pipeline.

	sed "s/^/pick /" <"$TODO.tmp" >"$TODO"

> +		else
> +			cat "$TODO.tmp" |

Likewise.

> +			while read -r shortsha1 rest
> +			do
>  				sha1=$(git rev-parse $shortsha1)
>  				if test -z "$REBASE_ROOT"
>  				then
> @@ -914,10 +915,12 @@ first and then run 'git rebase --continue' again."
>  				if test f = "$preserve"
>  				then
>  					touch "$REWRITTEN"/$sha1
> +					grep "^$shortsha1" "$TODO.tmp" | sed "s/^/pick /" >> "$TODO"

Don't pipe output of grep into sed.

	sed -ne "/^$shortsha1 /s/^/pick /p" <"$TODO.tmp" >>"$TODO"



--
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]