git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* git log FILE vs git log --follow FILE missing commits
@ 2020-02-02 21:27 Chris Packham
  2020-02-02 21:42 ` Kevin Daudt
  0 siblings, 1 reply; 3+ messages in thread
From: Chris Packham @ 2020-02-02 21:27 UTC (permalink / raw)
  To: GIT

Hi,

I've just hit a problem where git log doesn't want to tell me about a
commit that touches a specific file.

I wanted to point someone at a particular change that I knew was made
to a file so I fired up 'git log FILE' and to my surprise it wasn't
listed. I wondered if I had remembered wrong so went grepping to
confirm the change was in the file I thought it was, sure enough it
was there.

Poking around a bit I found that git log --follow FILE shows the
intended commit but git log FILE doesn't (it does show other commits
that touch the file, most of which have tags if that's significant).
The file hasn't been renamed so I didn't really expect --follow to
change any behavior.

The version of git I'm using is 2.25.0 from
http://ppa.launchpad.net/git-core/ppa/ubuntu bionic main. I also tried
2.24.1 and 2.23.1 with the same problem.

Any suggestions for tracking this down?

Thanks,
Chris

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: git log FILE vs git log --follow FILE missing commits
  2020-02-02 21:27 git log FILE vs git log --follow FILE missing commits Chris Packham
@ 2020-02-02 21:42 ` Kevin Daudt
  2020-02-02 21:53   ` Chris Packham
  0 siblings, 1 reply; 3+ messages in thread
From: Kevin Daudt @ 2020-02-02 21:42 UTC (permalink / raw)
  To: Chris Packham; +Cc: GIT

On Mon, Feb 03, 2020 at 10:27:52AM +1300, Chris Packham wrote:
> Hi,
> 
> I've just hit a problem where git log doesn't want to tell me about a
> commit that touches a specific file.
> 
> I wanted to point someone at a particular change that I knew was made
> to a file so I fired up 'git log FILE' and to my surprise it wasn't
> listed. I wondered if I had remembered wrong so went grepping to
> confirm the change was in the file I thought it was, sure enough it
> was there.
> 
> Poking around a bit I found that git log --follow FILE shows the
> intended commit but git log FILE doesn't (it does show other commits
> that touch the file, most of which have tags if that's significant).
> The file hasn't been renamed so I didn't really expect --follow to
> change any behavior.
> 
> The version of git I'm using is 2.25.0 from
> http://ppa.launchpad.net/git-core/ppa/ubuntu bionic main. I also tried
> 2.24.1 and 2.23.1 with the same problem.
> 
> Any suggestions for tracking this down?
> 
> Thanks,
> Chris

Hey Chris,

Try `git log --full-history FILE`. When passing a path to `git log` will
enable history simplification, which might explain why certain commits
are not shown.

Kind regards, Kevin.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: git log FILE vs git log --follow FILE missing commits
  2020-02-02 21:42 ` Kevin Daudt
@ 2020-02-02 21:53   ` Chris Packham
  0 siblings, 0 replies; 3+ messages in thread
From: Chris Packham @ 2020-02-02 21:53 UTC (permalink / raw)
  To: Kevin Daudt, Chris Packham, GIT

On Mon, Feb 3, 2020 at 10:42 AM Kevin Daudt <me@ikke.info> wrote:
>
> On Mon, Feb 03, 2020 at 10:27:52AM +1300, Chris Packham wrote:
> > Hi,
> >
> > I've just hit a problem where git log doesn't want to tell me about a
> > commit that touches a specific file.
> >
> > I wanted to point someone at a particular change that I knew was made
> > to a file so I fired up 'git log FILE' and to my surprise it wasn't
> > listed. I wondered if I had remembered wrong so went grepping to
> > confirm the change was in the file I thought it was, sure enough it
> > was there.
> >
> > Poking around a bit I found that git log --follow FILE shows the
> > intended commit but git log FILE doesn't (it does show other commits
> > that touch the file, most of which have tags if that's significant).
> > The file hasn't been renamed so I didn't really expect --follow to
> > change any behavior.
> >
> > The version of git I'm using is 2.25.0 from
> > http://ppa.launchpad.net/git-core/ppa/ubuntu bionic main. I also tried
> > 2.24.1 and 2.23.1 with the same problem.
> >
> > Any suggestions for tracking this down?
> >
> > Thanks,
> > Chris
>
> Hey Chris,
>
> Try `git log --full-history FILE`. When passing a path to `git log` will
> enable history simplification, which might explain why certain commits
> are not shown.
>
> Kind regards, Kevin.

Yes that shows the commit in question.

Based on the description of the default mode that actually makes
sense. The change in question was a removal, but there was a merge of
another branch that never contained the code that was removed. So the
simplest history involves commits from the branch that never contained
the change I was after.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-02-02 21:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-02 21:27 git log FILE vs git log --follow FILE missing commits Chris Packham
2020-02-02 21:42 ` Kevin Daudt
2020-02-02 21:53   ` Chris Packham

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).