git@vger.kernel.org mailing list mirror (one of many)
 help / Atom feed
From: biswaranjan panda <biswaranjan.nitrkl@gmail.com>
To: Jeff King <peff@peff.net>
Cc: Bryan Turner <bturner@atlassian.com>, git@vger.kernel.org
Subject: Re: Retrieving a file in git that was deleted and committed
Date: Sat, 8 Dec 2018 16:07:43 -0800
Message-ID: <CADHAf1Z=L2CeHax3nsP108yQr9G9xp+mhr+_F_zBcukr0kEFpQ@mail.gmail.com> (raw)
In-Reply-To: <20181208072915.GA20697@sigill.intra.peff.net>

>You can feed a set of revisions to git-blame with the "-S" option, but I
>don't offhand know how it handles diffs (I think it would have to still
>diff each commit against its parent, since history is non-linear, and a
>list is inherently linear). You might want to experiment with that.

>Other than that, you can play with git-replace to produce a fake
>history, as if the deletion never happened. But note that will affect
>all commands, not just one particular blame. It might be a neat way to
>play with blame, but I doubt I'd leave the replacement in place in the
>long term.

> -Peff

Ah I see. Will try git-replace. Thanks!

On Fri, Dec 7, 2018 at 11:29 PM Jeff King <peff@peff.net> wrote:
>
> On Fri, Dec 07, 2018 at 01:50:57PM -0800, biswaranjan panda wrote:
>
> > Thanks Jeff and Bryan! However, I am curious that if there were a way
> > to tell git blame to skip a commit (the one which added the file again
> > and maybe the one which deleted it originally) while it walks back
> > through history, then it should just get back the
> > entire history right ?
>
> Not easily. ;)
>
> You can feed a set of revisions to git-blame with the "-S" option, but I
> don't offhand know how it handles diffs (I think it would have to still
> diff each commit against its parent, since history is non-linear, and a
> list is inherently linear). You might want to experiment with that.
>
> Other than that, you can play with git-replace to produce a fake
> history, as if the deletion never happened. But note that will affect
> all commands, not just one particular blame. It might be a neat way to
> play with blame, but I doubt I'd leave the replacement in place in the
> long term.
>
> -Peff



-- 
Thanks,
-Biswa

  reply index

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-07  6:49 biswaranjan panda
2018-12-07  6:55 ` Bryan Turner
2018-12-07  7:07   ` biswaranjan panda
2018-12-07  7:20     ` Jeff King
2018-12-07  7:37       ` Bryan Turner
2018-12-07 21:50         ` biswaranjan panda
2018-12-08  7:29           ` Jeff King
2018-12-09  0:07             ` biswaranjan panda [this message]
2018-12-11  1:19             ` Junio C Hamano
2018-12-10 21:33       ` Elijah Newren
2018-12-11  9:46         ` Jeff King
2018-12-10 15:12 ` Sergey Organov

Reply instructions:

You may reply publically 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='CADHAf1Z=L2CeHax3nsP108yQr9G9xp+mhr+_F_zBcukr0kEFpQ@mail.gmail.com' \
    --to=biswaranjan.nitrkl@gmail.com \
    --cc=bturner@atlassian.com \
    --cc=git@vger.kernel.org \
    --cc=peff@peff.net \
    /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

git@vger.kernel.org mailing list mirror (one of many)

Archives are clonable:
	git clone --mirror https://public-inbox.org/git
	git clone --mirror http://ou63pmih66umazou.onion/git
	git clone --mirror http://czquwvybam4bgbro.onion/git
	git clone --mirror http://hjrcffqmbrq6wope.onion/git

Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.version-control.git
	nntp://ou63pmih66umazou.onion/inbox.comp.version-control.git
	nntp://czquwvybam4bgbro.onion/inbox.comp.version-control.git
	nntp://hjrcffqmbrq6wope.onion/inbox.comp.version-control.git
	nntp://news.gmane.org/gmane.comp.version-control.git

 note: .onion URLs require Tor: https://www.torproject.org/
       or Tor2web: https://www.tor2web.org/

AGPL code for this site: git clone https://public-inbox.org/ public-inbox