From: Junio C Hamano <gitster@pobox.com>
To: Steve Litt <slitt@troubleshooters.com>
Cc: git@vger.kernel.org
Subject: Re: How to delete files and directories from git commit history?
Date: Tue, 12 Jun 2018 13:36:14 -0700 [thread overview]
Message-ID: <xmqqk1r391z5.fsf@gitster-ct.c.googlers.com> (raw)
In-Reply-To: <20180612154413.3df64441@mydesk.domain.cxm> (Steve Litt's message of "Tue, 12 Jun 2018 15:44:13 -0400")
Steve Litt <slitt@troubleshooters.com> writes:
> But then I view all filenames from that directory that have ever been
> in the project, as follows:
>
> git cat-file --buffer --batch-all-objects \
> --batch-check='%(objecttype) %(objectname)' \
> | grep ^c | cut -d " " -f 2 \
> | xargs -n 1 git ls-tree -r | sort | uniq \
> | grep propdir
>
> The preceding command lists directory docs/propdir and all the files
> it's ever contained....
In which repository did you run this? As cat-file's documentation
clearly states, --batch-all-objects does not *care* about the
reachability, so even after rewriting the history using
filter-branch, as long as you have the original objects before your
history rewrite in the repository, it _will_ see those trees with
propdir, even if they are now unreachable thanks to your
filter-branch. If you are doing the above in the original (or in a
local clone), try running "git repack -a -d && git prune
--expire=now" after filter-branch.
prev parent reply other threads:[~2018-06-12 20:36 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-12 19:44 How to delete files and directories from git commit history? Steve Litt
2018-06-12 20:25 ` Eckhard Maaß
2018-06-12 20:26 ` Christian Couder
2018-06-12 20:33 ` Eric Sunshine
2018-06-12 20:36 ` Junio C Hamano [this message]
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqk1r391z5.fsf@gitster-ct.c.googlers.com \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=slitt@troubleshooters.com \
/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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox