From: Sergey Organov <sorganov@gmail.com>
To: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Cc: Eric Sunshine <sunshine@sunshineco.com>,
Git List <git@vger.kernel.org>,
Junio C Hamano <gitster@pobox.com>,
Thomas Rast <tr@thomasrast.ch>, Denton Liu <liu.denton@gmail.com>
Subject: Re: [PATCH RFC v1] stash: implement '--staged' option for 'push' and 'save'
Date: Tue, 12 Oct 2021 14:20:02 +0300 [thread overview]
Message-ID: <8735p67an1.fsf@osv.gnss.ru> (raw)
In-Reply-To: <87y26yk35r.fsf@evledraar.gmail.com> ("Ævar Arnfjörð Bjarmason"'s message of "Tue, 12 Oct 2021 11:18:38 +0200")
Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:
> On Tue, Oct 12 2021, Sergey Organov wrote:
>
>> Eric Sunshine <sunshine@sunshineco.com> writes:
>>
>>> /On Mon, Oct 11, 2021 at 4:17 PM Sergey Organov <sorganov@gmail.com> wrote:
>>>> Stash only the changes that are staged.
>>>>
>>>> This mode allows to easily stash-out for later reuse some changes
>>>> unrelated to the current work in progress.
>>>>
>>>> Unlike 'stash push --patch', --staged supports using of any tool to
>>>> select the changes to stash-out, including, but not limited to 'git
>>>> add --interactive'.
>>>
>>> s/using of any/use of any/
>>> ...or...
>>> s/using of any/using any/
>>
>> Will fix, thanks!
>>
>>>
>>>> Signed-off-by: Sergey Organov <sorganov@gmail.com>
>>>> ---
>>>> diff --git a/builtin/stash.c b/builtin/stash.c
>>>> @@ -1656,6 +1716,8 @@ static int save_stash(int argc, const char **argv, const char *prefix)
>>>> + OPT_BOOL('S', "staged", &only_staged,
>>>> + N_("stash in patch mode")),
>>>> OPT_BOOL('p', "patch", &patch_mode,
>>>> N_("stash in patch mode")),
>>>> OPT__QUIET(&quiet, N_("quiet mode")),
>>>
>>> Copy/paste error in new help/description string?
>>
>> Yep.
>>
>> Thanks,
>>
>
> I very much like this option, I've sometimes missed it in "git stash",
> and was always going to dig into if there was some way to do it.
>
> The one thing I'm a bit iffy on is if this is consistent with the
> --staged options in other commands (with some taking --cached and/or
> --staged), I think so, and this is a good name.
>
> But is the -S option used as a shorthand for --staged somewhere else?
> *Checks*, ah yes, for "git restore", then we use "stage" for
> checkout-index/ls-files, the latter of which has a 's' (not
> capital-letter 'S') shorthand.
>
> I *think* that just -s/--stage would make more sense here, but I've only
> looked at it briefly, but getting options consistent if possible is in
> general quite nice for users, so we should think about it...
I grepped the Documentation/ and found -S,--staged in the
"git-restore.txt":
-S::
--staged::
Specify the restore location.
, so I used the same shorthand, even though I personally would use -s as
well.
In addition, the problem with -s is that it's used in a lot of places
for entirely unrelated option(s).
Thanks,
-- Sergey Organov
next prev parent reply other threads:[~2021-10-12 11:20 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-01 22:12 [PATCH RFC] stash: implement '--staged' option for 'push' and 'save' Sergey Organov
2021-10-11 20:16 ` [PATCH RFC v1] " Sergey Organov
2021-10-11 21:21 ` Eric Sunshine
2021-10-11 21:55 ` Sergey Organov
2021-10-12 9:18 ` Ævar Arnfjörð Bjarmason
2021-10-12 11:20 ` Sergey Organov [this message]
2021-10-12 12:04 ` Junio C Hamano
2021-10-12 12:34 ` Junio C Hamano
2021-10-12 16:07 ` Sergey Organov
2021-10-12 17:28 ` Junio C Hamano
2021-10-12 18:25 ` Sergey Organov
2021-10-13 4:48 ` Junio C Hamano
2021-10-13 13:43 ` Sergey Organov
2021-10-15 15:04 ` [PATCH v2] " Sergey Organov
2021-10-15 17:58 ` Junio C Hamano
2021-10-15 19:05 ` Sergey Organov
2021-10-15 19:22 ` Junio C Hamano
2021-10-15 20:14 ` Sergey Organov
2021-10-15 20:21 ` Sergey Organov
2021-10-18 16:09 ` [PATCH v3] " Sergey Organov
2021-10-26 5:05 ` Jeff King
2021-10-27 15:11 ` Sergey Organov
2021-10-27 15:20 ` [PATCH v4] " Sergey Organov
2021-10-27 21:19 ` Junio C Hamano
2021-10-28 8:29 ` [PATCH] stash: get rid of unused argument in stash_staged() Sergey Organov
2021-10-28 21:17 ` Junio C Hamano
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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8735p67an1.fsf@osv.gnss.ru \
--to=sorganov@gmail.com \
--cc=avarab@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=liu.denton@gmail.com \
--cc=sunshine@sunshineco.com \
--cc=tr@thomasrast.ch \
/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.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).