git/list[1] front-page[2] threads[3] people[4] search[5] about
 

How to find the commit that erase a change

From
Wwuzhouhui <wuzhouhui14@mails.ucas.ac.cn>
Date
Oct 9, 2019, 02:28 UTC
Message-ID
<5e12e2d8.1ed16.16dae58d6ac.Coremail.wuzhouhui14@mails.ucas.ac.cn>
Hi,
I have a file which contains complicated change history. When I use
    git log -p file
to see all changes made in this file, I found that a change disappeared
for no reason.
For example, I made following change in a commit:
@@ -2,3 +2,8 @@ int main(void)
 {
        printf("hello world");
 }
+
+func(void)
+{
+       printf("a func");
+}

But when I open this file of latest version, I found the above change is
disappeared. So I decide use
    git log -p file
to see which commit erase my change. But I doesn't see any commit which
contains changes like following:

@@ -2,8 +2,3 @@ int main(void)
 {
        printf("hello world");
 }
-
-func(void)
-{
-       printf("a func");
-}

So, how to find the commit that erase my change?

Thanks. Please use Reply-All when reply this email.
Next: Junio C Hamano
Message 1 of 4 in “How to find the commit that erase a change”
  1. wuzhouhuiOct 9, 2019
  2. Junio C HamanoOct 9, 2019
  3. wuzhouhuiOct 9, 2019
  4. Derrick StoleeOct 9, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.