From: Junio C Hamano <gitster@pobox.com>
To: Ramkumar Ramachandra <artagnon@gmail.com>
Cc: Git List <git@vger.kernel.org>
Subject: Re: [PATCH 7/7] rebase: implement --[no-]autostash and rebase.autostash
Date: Sun, 12 May 2013 23:28:10 -0700 [thread overview]
Message-ID: <7vd2svqtqd.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <1368359801-28121-8-git-send-email-artagnon@gmail.com> (Ramkumar Ramachandra's message of "Sun, 12 May 2013 17:26:41 +0530")
Ramkumar Ramachandra <artagnon@gmail.com> writes:
> +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')"
Writing it like this:
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')"
with a blank line before the next "echo", it would be more readable.
As I said in a separate message, having a code that knows where
"stash" is and how it is organized outside the implementation of
"git stash" is less than ideal. It probably makes more sense to
let programs like this to say:
git stash store -m "autostash" $stash_sha1 || exit
> + echo "
> +$(gettext 'Applying autostash resulted in conflicts.
> +Your changes are safe in the stash.
> +You can apply or drop it at any time.')"
This feels funny. Why not
gettext "$msg"
without an extra command substitution with an echo?
next prev parent reply other threads:[~2013-05-13 6:28 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-12 11:56 [PATCH v3 0/7] rebase.autostash completed Ramkumar Ramachandra
2013-05-12 11:56 ` [PATCH 1/7] am: tighten a conditional that checks for $dotest Ramkumar Ramachandra
2013-05-12 11:56 ` [PATCH 2/7] rebase -i: don't error out if $state_dir already exists Ramkumar Ramachandra
2013-05-12 11:56 ` [PATCH 3/7] rebase: prepare to do generic housekeeping Ramkumar Ramachandra
2013-05-12 11:56 ` [PATCH 4/7] am: return control to caller, for housekeeping Ramkumar Ramachandra
2013-05-12 11:56 ` [PATCH 5/7] rebase -i: " Ramkumar Ramachandra
2013-05-12 11:56 ` [PATCH 6/7] rebase --merge: " Ramkumar Ramachandra
2013-05-12 11:56 ` [PATCH 7/7] rebase: implement --[no-]autostash and rebase.autostash Ramkumar Ramachandra
2013-05-13 6:28 ` Junio C Hamano [this message]
2013-05-13 8:03 ` Ramkumar Ramachandra
2013-05-13 13:49 ` Junio C Hamano
2013-05-13 13:52 ` Ramkumar Ramachandra
2013-05-13 8:24 ` Matthieu Moy
2013-05-13 8:27 ` Ramkumar Ramachandra
2013-05-13 8:41 ` Matthieu Moy
2013-05-13 4:57 ` [PATCH v3 0/7] rebase.autostash completed Junio C Hamano
2013-05-13 7:59 ` Ramkumar Ramachandra
2013-05-13 8:32 ` Matthieu Moy
2013-05-13 14:02 ` Junio C Hamano
2013-05-13 14:00 ` Junio C Hamano
2013-05-13 14:17 ` Ramkumar Ramachandra
2013-05-13 14:56 ` Junio C Hamano
-- strict thread matches above, loose matches on Subject: below --
2013-04-23 14:01 [PATCH 0/7] Introduce rebase.autostash Ramkumar Ramachandra
2013-04-23 14:02 ` [PATCH 7/7] rebase: implement --[no-]autostash and rebase.autostash Ramkumar Ramachandra
2013-04-23 17:07 ` Junio C Hamano
2013-04-23 17:34 ` Junio C Hamano
2013-04-23 17:37 ` Ramkumar Ramachandra
2013-04-23 22:45 ` Phil Hord
2013-04-24 8:27 ` Ramkumar Ramachandra
2013-04-24 17:52 ` Matthieu Moy
Reply instructions:
You may reply publicly 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:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7vd2svqtqd.fsf@alter.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=artagnon@gmail.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.