lmi
[Top][All Lists]
Advanced

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

Re: [lmi] git-checkout deleted files [Was: static_assert and :argdo]


From: Greg Chicares
Subject: Re: [lmi] git-checkout deleted files [Was: static_assert and :argdo]
Date: Sun, 5 Mar 2017 17:20:27 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Icedove/45.6.0

On 2017-03-05 16:36, Vadim Zeitlin wrote:
> On Sun, 5 Mar 2017 14:33:09 +0000 Greg Chicares <address@hidden> wrote:
> 
> GC> BTW, I believe this is the command I was seeking:
> GC> 
> GC> git ls-files --deleted | xargs git checkout --
> GC> 
> GC> It doesn't overwrite anything that's still in the working directory,
> GC> so it's quite safe.
> 
>  Thanks, I didn't know about "ls-files --deleted", however I should have
> thought about the same pipeline using "diff --name-only --diff-filter=D".
> And I post it here now just because I find --diff-filter very useful, e.g.
> I often use it (with or without --name-only) to list only the files with
> the conflicts ("=U"), so maybe it might serve you too in the future.

Thanks, I didn't know about --diff-filter, and it's much better than
some of the atrocious shell 'for' commands I've been using recently.
It's especially helpful this morning because my furnace stopped
working while it was minus thirteen celsius outside, and my fingers
are still numb even though it's fixed now.

Oh, and BTW, I won't even mention the commands I was using to find
empty function bodies (i.e., '{\n}') with grep and sed before I
found out that I can just
  $vim --cmd "vim '{\n}' *.?pp




reply via email to

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