git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [Feature- Request] Option to commit after checking out branch command is made
@ 2017-11-15 15:27 Ninivaggi Mattia
  2017-11-16  0:19 ` Junio C Hamano
  0 siblings, 1 reply; 4+ messages in thread
From: Ninivaggi Mattia @ 2017-11-15 15:27 UTC (permalink / raw)
  To: git@vger.kernel.org

Hey guys

Sometimes I tend to forget to commit changes before I checkout another branch and the following scenario happens (via cli on windows [with git bash]):

1. I checkout a branch, without having commited first
    > git checkout dev
2. I get this error message:
    > error: Your local changes to the following files would be overwritten by checkout:
    > // List of files
    > // ..
    > //
    > Please commit your changes or stash them before you switch branches.

But I would rather prefer a scenario like this:

1. I checkout a branch, without having commited first
    > git checkout dev
2. I get a message like this:
    > Your local changes to the following files would be overwritten by checkout:
    > // List of files
    > // ..
    > //
    > Would you want to commit first? (y/n))

IF y --> prompt for commit message and commit automatically
IF n --> display error message: "Please commit your changes or stash them before you switch branches"

This would be a faster/ more productive way to handle this error.

I think it wont be a big challenge, you just should put a message in the cli-tool when this error occurs and call the commit functionality if "y" is pressed. If you'd like I'll even consider doing it myself. If you have some documentation or some tipps on where to look for it.

Cheers

Ninivaggi Mattia

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-06-03  8:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-15 15:27 [Feature- Request] Option to commit after checking out branch command is made Ninivaggi Mattia
2017-11-16  0:19 ` Junio C Hamano
2017-11-16 11:19   ` Ninivaggi Mattia
     [not found]   ` <CAGe7hXBPWvjaKZtz-Zn1az0HrCx=OpxGsghVJhLOBKMu3NJ2zA@mail.gmail.com>
2019-06-03  8:44     ` Fwd: " David Eisner

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).