git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Philip Oakley <philipoakley@iee.email>
To: Colin Kennedy <colin@mrkennedy.ca>, git@vger.kernel.org
Subject: Re: feature request: add [-f|--from <rootbranch>] to git stash branch
Date: Fri, 14 Jan 2022 14:53:51 +0000	[thread overview]
Message-ID: <851ecd86-02d0-b078-1c90-ebe75ad46926@iee.email> (raw)
In-Reply-To: <2a4f90e9-9abb-40b6-a6f3-a676567e4fc0@www.fastmail.com>

Hi, some minor comments, in-line.

On 13/01/2022 16:29, Colin Kennedy wrote:
> Current syntax of git stash branch is:
>
> branch <branchname> [<stash>]
>
> Proposed syntax is:
>
> branch <branchname> [-f|--from <rootbranch>] [<stash>]

Just to say that the `-f` is typically reserved/used for the --force
option if available.
>
> the from flag specifies a branch from which the new branch should be derived.
>
> Example usage:
>
> git stash branch remove-commented-code --from main
>
> This simplifies a workflow which is common for me. I am working N-commits deep in some feature branch when I discover a low hanging fruit. Dealing with this low hanging fruit is not appropriate for the current feature branch. It's most appropriate to deal with "directly" on a fresh branch from main. Because I am untidy, 
Maybe an example that shows the level of untidiness might help to
clarify the suggestion, as to what is included/not included, and how it
makes it easy later when the stash is recovered.

> I often have a bit of mess in between my staging area, and unstaged changes, and this creates friction when I attempt to stash this low hanging fruit, pop back to main, create the new branch, pop the stashed low hanging fruit, etc etc.
>
> The proposed flag gives a one-liner to apply stashed patches wherever, no matter your current location, which I think is an improvement.
>
> Happy to have feedback on the flag. Happy for someone else to implement it. Also happy to consider taking a crack at it myself if it seems like something people would be happy to include. (NB: I haven't written or even read any c, or c++ for that matter, in probably 15 years. So, you know).
>
> thanks,
> Colin


  reply	other threads:[~2022-01-14 14:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-13 16:29 feature request: add [-f|--from <rootbranch>] to git stash branch Colin Kennedy
2022-01-14 14:53 ` Philip Oakley [this message]
2022-01-14 19:02   ` 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=851ecd86-02d0-b078-1c90-ebe75ad46926@iee.email \
    --to=philipoakley@iee.email \
    --cc=colin@mrkennedy.ca \
    --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.
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).