All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Malik Rumi <malik.a.rumi@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: recover lost file
Date: Fri, 10 Nov 2023 14:27:47 +0900	[thread overview]
Message-ID: <xmqq1qcyw52k.fsf@gitster.g> (raw)
In-Reply-To: <xmqqmsvmw8oc.fsf@gitster.g> (Junio C. Hamano's message of "Fri, 10 Nov 2023 13:09:55 +0900")

Junio C Hamano <gitster@pobox.com> writes:

> You only said "a lost file" without giving any specifics, so it is
> totally unclear to readers of your message how strings like
> "titlesplit" and "filesplit" relate to what you are looking for.  In
> the above I randomly made a blind guess that it might be a function
> name, but I may be totally off the mark.
>
>  - Do you mean "I think the file I removed had a name with either
>    titlesplit or filesplit in it?"
>
>  - Or do you mean "I know that the file had a definition of a
>    function whose name was either titlesplit or filesplit?"
>
>  - Or something completely different from the above two?
>
> If I know all of the followings are true:
>
>  - I had the necessary contents committed in Git;
>
>  - I do not remember the filename at all, but I am sure I deleted it
>    and committed the deletion some time ago;
>
>  - I know the lost contents I am looking for had a string "frotz" in
>    it.
>
> then I would probably try
>
>     $ git log -Sfrotz --diff-filter=D -p
>
> which will look for all file deletions throughout the history,
> limiting the output to those that had string "frotz" in them.
>
> But again, it is unclear what useful clue you have to locate the
> lost file from your description, so ...

If the scenario were

 - I know the file were once committed in Git;

 - I do not remember the filename, but I think its name had either
   "frotz" or "nitfol" in it;

then I would try this instead:

    $ git log --diff-filter=D --summary -- '*frotz*' '*nitfol*'





      reply	other threads:[~2023-11-10  6:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-10  3:02 recover lost file Malik Rumi
2023-11-10  4:09 ` Junio C Hamano
2023-11-10  5:27   ` 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=xmqq1qcyw52k.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=malik.a.rumi@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.