git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Filipp Bakanov <filipp@bakanov.su>
To: "Theodore Y. Ts'o" <tytso@mit.edu>
Cc: Junio C Hamano <gitster@pobox.com>, git@vger.kernel.org
Subject: Re: Proposal: "unadd" command / alias.
Date: Wed, 28 Oct 2020 01:02:11 +0300	[thread overview]
Message-ID: <CAAdniQ4vx4z9KnfvG7thzxf1xBa=P_nnbY1G=RTFUBb4Zxqeaw@mail.gmail.com> (raw)
In-Reply-To: <20201027215638.GI5691@mit.edu>

>> Indeed, I have a similar alias in my ~/.gitconfig

Why not just add it to git by default for everybody? revert-file is
also ok, anything except `checkout HEAD --` will be good.

On Wed, 28 Oct 2020 at 00:56, Theodore Y. Ts'o <tytso@mit.edu> wrote:
>
> On Tue, Oct 27, 2020 at 01:32:50PM -0700, Junio C Hamano wrote:
> > Filipp Bakanov <filipp@bakanov.su> writes:
> >
> > > Hi! I suggest to add "unadd" command, that will undo a git add command.
> > >
> > > git unadd path/to/file
> > >
> > > It will be an alias to:
> > >
> > > git reset HEAD -- path/to/file
> > >
> > > The motivation is that I always forget syntax and have to google each
> > > time I want to undo accidentally added files. Unadd is just much
> > > easier to remember and quite obvious.
> >
> > The alias is for you to do the above, I think.
>
> Filipp,
>
> Indeed, I have a similar alias in my ~/.gitconfig
>
> [alias]
>         revert-file = checkout HEAD --
>
> Adding
>
> [alias]
>         unadd = reset HEAD --
>
> to your .gitconfig would do what you want.  As a BTW, my favorite
> alias is:
>
>    lgt = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%Creset' --abbrev-commit
>
> Sample usage: "git lgt origin.." or "git lgt -10".
>
> Cheers,
>
>                                         - Ted

  reply	other threads:[~2020-10-27 22:02 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-27 20:10 Proposal: "unadd" command / alias Filipp Bakanov
2020-10-27 20:32 ` Junio C Hamano
2020-10-27 21:56   ` Theodore Y. Ts'o
2020-10-27 22:02     ` Filipp Bakanov [this message]
2020-10-27 22:54       ` Theodore Y. Ts'o
2020-10-27 23:14         ` Filipp Bakanov
2020-10-28 11:00           ` Philip Oakley
2020-10-28 12:13 ` Konstantin Tokarev
2020-10-28 12:21   ` Filipp Bakanov
2020-10-28 13:07 ` Pratyush Yadav
2020-10-28 13:56   ` Filipp Bakanov
2020-10-28 23:44 ` 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='CAAdniQ4vx4z9KnfvG7thzxf1xBa=P_nnbY1G=RTFUBb4Zxqeaw@mail.gmail.com' \
    --to=filipp@bakanov.su \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=tytso@mit.edu \
    /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).