Re: [PATCH 8/8] rebase: implement --[no-]autostash and rebase.autostash
- From
Junio C Hamano <gitster@pobox.com>
- Date
- May 10, 2013, 15:29 UTC
- Message-ID
- <7v38tu4zv7.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <1368196005-5354-9-git-send-email-artagnon@gmail.com>
Ramkumar Ramachandra <artagnon@gmail.com> writes:
Show 15 quoted lines
> +finish_rebase () {
> + if test -f "$state_dir/autostash"
> + then
> + stash_sha1=$(cat "$state_dir/autostash")
> + if git stash apply $stash_sha1 2>&1 >/dev/null
> + then
> + echo "Applied autostash"
> + else
> + ref_stash=refs/stash &&
> + : >>"$GIT_DIR/logs/$ref_stash" &&
> + git update-ref -m "autostash" $ref_stash $stash_sha1 \
> + || die "$(eval_gettext 'Cannot store $stash_sha1')" &&
> + echo "
> +$(gettext 'Applying autostash resulted in conflicts.
> +...This is confusing (or confused):
these && might && fail
|| die &&
successIt is much easier to read if you just drop && after die and write it like so: ref_stash=refs/stash && : >>"$GIT_DIR/logs/$ref_stash" && git update-ref -m "autostash" $ref_stash $stash_sha1 || die "$(eval_gettext 'Cannot store $stash_sha1')"
echo "... success message comes here..."