emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: On the adoption of transient.el


From: John Yates
Subject: Re: On the adoption of transient.el
Date: Sun, 15 Aug 2021 17:57:27 -0400

On Sat, Aug 14, 2021 at 8:55 AM Óscar Fuentes <ofv@wanadoo.es> wrote:
> Arthur Miller <arthur.miller@live.com> writes:
> > The strategy is to stash save all buffers belonging to the project,
> > stash everything, inclusive untracked files, and than checkout to the
> > other branch. When checked back, the stash is applied back. I don't know
> > if you have something like that in magit or if it is something generally
> > desirable, but I always wanted something simple and dirty to be able to
> > switch fast when I need it.
>
> How would Magit know that when you "return back" to a branch it must
> apply a certain stash?

Rather than use a stash I would have a script that does two things:
* Creates an undo script for the next step
* Saves everything important as a new commit on the current branch.
  This would include, among other things, all untracked files and the
  undo script mentioned in the first step.

Now with the workspace in a clean state you can switch away to some
other branch.  When you return to the original branch you run the undo
script.  It backs out the last commit.  This would included performing

    git rm --cached <all originally untracked files>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]