From: Avery Pennarun <apenwarr@gmail.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Junio C Hamano <gitster@pobox.com>, Jeff King <peff@peff.net>,
Graham Perks <gperks@ausperks.net>,
Git List <git@vger.kernel.org>
Subject: Re: Am able to delete a file with no trace in the log
Date: Wed, 3 Jun 2009 17:59:07 -0400 [thread overview]
Message-ID: <32541b130906031459p32640f4dte5e2e079cf4093d7@mail.gmail.com> (raw)
In-Reply-To: <alpine.LFD.2.01.0906031431100.4880@localhost.localdomain>
On Wed, Jun 3, 2009 at 5:33 PM, Linus Torvalds
<torvalds@linux-foundation.org> wrote:
> On Wed, 3 Jun 2009, Junio C Hamano wrote:
>> E.g. "git log --graph --oneline -- git-clone.sh" shows that the scripted
>> version ceased to exist at 8434c2f
>
> Btw, this example misses the whole point of the original problem.
>
> The original problem was:
>
> - create new file 'x' in branch 'a'
>
> - merge branch 'a' into branch 'b', but because of a merge conflict and
> confurion in the merge, the merge result doesn't contain 'x' any more.
>
> - try to find out what happened to 'x' after-the-fact.
>
> Try it. Git really doesn't make it very easy, because git will notice that
> 'x' didn't exist before the branch either (in branch 'b'), so there will
> be _no_ sign of 'x' actually going away.
Note that full-file deletion is only one particular case of a general
problem. Consider this script:
===
#!/bin/bash
rm -rf testb
mkdir testb
cd testb
git init
echo 'initial a' >a
echo 'initial b' >b
git add a b
git commit -m 'initial commit'
git branch sub
echo 'first a change' >>a
git add a
git commit -m 'modify a'
git checkout sub
echo 'second a change' >>a
git add a
git commit -m 'modify a differently'
git checkout master
git merge -s ours sub
===
"git log -p" will show the addition of the line "second a change" to
a, but it doesn't show that, in fact, this line was later deleted
because of a botched merge. There is no obvious way to find out in
which commit the line was lost. If someone doing a code review is
reviewing all the patches from "git log -p", then they'll miss the
fact that this patch was lost.
('git log -p -- a" doesn't show that the line was added at all - which
is true, in some sense, but it's equally true that, in the example you
gave, 'x' was never added.)
Have fun,
Avery
next prev parent reply other threads:[~2009-06-03 21:59 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-02 19:33 Am able to delete a file with no trace in the log Graham Perks
2009-06-02 20:29 ` Tony Finch
2009-06-02 21:34 ` Jeff King
2009-06-02 21:55 ` Linus Torvalds
2009-06-03 0:47 ` Sitaram Chamarty
2009-06-03 1:20 ` Linus Torvalds
2009-06-03 1:34 ` Clean up and simplify rev_compare_tree() Linus Torvalds
2009-06-03 1:57 ` Am able to delete a file with no trace in the log Junio C Hamano
2009-06-03 3:03 ` Linus Torvalds
2009-06-03 21:18 ` Junio C Hamano
2009-06-03 21:26 ` Linus Torvalds
2009-06-03 21:33 ` Linus Torvalds
2009-06-03 21:59 ` Avery Pennarun [this message]
2009-06-03 22:02 ` Junio C Hamano
2009-06-03 22:17 ` Linus Torvalds
2009-06-03 22:38 ` Junio C Hamano
2009-06-03 22:44 ` Jeff King
2009-06-03 22:56 ` Linus Torvalds
2009-06-03 23:06 ` Jeff King
2009-06-03 23:27 ` Linus Torvalds
2009-06-03 23:37 ` Jeff King
2009-06-04 1:58 ` Linus Torvalds
2009-06-04 6:57 ` Junio C Hamano
2009-06-03 22:47 ` Linus Torvalds
2009-06-03 22:56 ` Junio C Hamano
2009-06-03 21:55 ` Junio C Hamano
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
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=32541b130906031459p32640f4dte5e2e079cf4093d7@mail.gmail.com \
--to=apenwarr@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=gperks@ausperks.net \
--cc=peff@peff.net \
--cc=torvalds@linux-foundation.org \
/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.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).