git log -p path/to/file doesn't show all changes


x-yuri

I want it to show all changes (commits) to the specified file, but it doesn't do that. It only shows some of them. I guess it has something to do with merging, but I don't see what could be wrong here. Can someone explain?

UPD I was able to reproduce my specific issue in the test repository:

#!/usr/bin/env bash
set -eu
rm -rf 1
mkdir 1 && cd 1
git init

mkdir 1
echo m1 > 1/m1 && git add 1/m1 && git commit -m m1

git co -b b1
echo m11 > 1/m1 && git add 1/m1 && git commit -m b11
echo m1 > 1/m1 && git add 1/m1 && git commit -m b12

git checkout master
echo m2 > m2 && git add m2 && git commit -m m2
git merge b1 -m 'merge b1'
git --no-pager log --graph --oneline --decorate --all
git --no-pager log --oneline 1

commit b11, b12and is not listed in the last command.

x-yuri

So I basically answered my question more or less, trying to reproduce the problem in the test repo. In my case it happened when a feature branch changed a file and then restored it to its original state. That is, when the entire merge made no changes to the file. However, don't know why this is happening. But it must have something to do with simplifying history .

Related


git diff doesn't show all changes

User 2719875 I have a file named app.js. I added lines 131-136, removed lines 83-84 and added lines 88-91. When I type git status, it shows app.jschanged. When I type git diff, it only shows lines 131-136 added and lines 83-84 removed. It doesn't show the adde

git diff doesn't show all changes

User 2719875 I have a file named app.js. I added lines 131-136, removed lines 83-84 and added lines 88-91. When I type git status, it shows app.jschanged. When I type git diff, it only shows lines 131-136 added and lines 83-84 removed. It doesn't show the adde

git log --author doesn't show all commits

Patrick Old I've made a dozen commits, but when I do a commit, I git log --author=pauldonly see the last three. Without the author filter, the full history will be displayed. I've tried variations --full-historyof other options , but nothing seems to work. For

How to get git log -p to show changes in merge commits

5 seconds I have a branch with a missing function definition, but the function is still being used, causing a crash. Feature definitions must have been removed during the merge. I've done 'git log -p' and searched for the function definition, and I can see it'

How to get git log -p to show changes in merge commits

5 seconds I have a branch with a missing function definition, but the function is still being used, causing a crash. Feature definitions must have been removed during the merge. I've done 'git log -p' and searched for the function definition, and I can see it'

How to get git log -p to show changes in merge commits

5 seconds I have a branch with a missing function definition, but the function is still being used, causing a crash. Feature definitions must have been removed during the merge. I've done 'git log -p' and searched for the function definition, and I can see it'

How to get git log -p to show changes in merge commits

5 seconds I have a branch with a missing function definition, but the function is still being used, causing a crash. Feature definitions must have been removed during the merge. I've done 'git log -p' and searched for the function definition, and I can see it'

How to get git log -p to show changes in merge commits

5 seconds I have a branch with a missing function definition, but the function is still being used, causing a crash. Feature definitions must have been removed during the merge. I've done 'git log -p' and searched for the function definition, and I can see it'

Git log doesn't show anything on console

lazy I am using Kubuntu 16.4. lts. Recently, I updated the package with the following command: sudo aptitude update && sudo aptitude upgrade Since then, the command git logno longer provides any output. git log > /tmp/gitlog.txtHowever, when used , the file c

Git log doesn't show anything on console

lazy I am using Kubuntu 16.4. lts. Recently, I updated the package with the following command: sudo aptitude update && sudo aptitude upgrade Since then, the command git logno longer provides any output. git log > /tmp/gitlog.txtHowever, when used , the file c

Git log doesn't show anything on console

lazy I am using Kubuntu 16.4. lts. Recently, I updated the package with the following command: sudo aptitude update && sudo aptitude upgrade Since then, the command git logno longer provides any output. git log > /tmp/gitlog.txtHowever, when used , the file c

git log --oneline doesn't work, doesn't show anything

Abraham In vscode, I have a repo with two commits, ie. "first commit"and "second commit". I am using git through vscode powershell terminal. git logworks fine, it returns commit ffd6d05ac4b94fa5a85c9ca43798e436df8b3097 Author: myname <myemail> Date: Sat Mar

Visual Studio: Git Team Explorer doesn't show any changes

tip When I add the project to source control (GIT) for the first time, it shows all the files and everything is pretty peach. I can keep working for about 30 minutes to 1 hour with all changes showing up (any file changes I make). But after some time it shows

Git doesn't show committed changes or history for some files

Grand Slam Not sure if this is the answer as searching google or stack overflow has not helped so far (I may have used the wrong keyword). I'm new to using Git and have installed/tried Source-tree and Git Desktop to pull/push/commit from my git server. The pro

Visual Studio: Git Team Explorer doesn't show any changes

tip When I add the project to source control (GIT) for the first time, it shows all the files and everything is pretty peach. I can keep working for about 30 minutes to 1 hour with all changes showing up (any file changes I make). But after some time it shows

Git doesn't show changes even though file has changed

Alex Is git broken or are we doing something wrong? ;-) We found out that a file has changed in the latest version of the git repository and I am trying to figure out when it was used whatchanged. how so: $ git checkout 27773b72432e86d308d25d666663f237e50aa3fd

Git doesn't show changes even though file has changed

Alex Is git broken or are we doing something wrong? ;-) We found out that a file has changed in the latest version of the git repository and I am trying to figure out when it was used whatchanged. how so: $ git checkout 27773b72432e86d308d25d666663f237e50aa3fd

Git doesn't show changes even though file has changed

Alex Is git broken or are we doing something wrong? ;-) We found out that a file has changed in the latest version of the git repository and I am trying to figure out when it was used whatchanged. how so: $ git checkout 27773b72432e86d308d25d666663f237e50aa3fd

Visual Studio: Git Team Explorer doesn't show any changes

tip When I add the project to source control (GIT) for the first time, it shows all the files and everything is pretty peach. I can keep working for about 30 minutes to 1 hour with all changes showing up (any file changes I make). But after some time it shows

Why doesn't git range-diff show commit changes?

Eugen Konkov I compared two ranges: Why git range-diffdoesn't it show the difference? when 3a8cand 2340commits are different: Tuesday We can see from the first image that git range-diffit decides to completely remove a patch in its original extent and provides

Visual Studio: Git Team Explorer doesn't show any changes

tip When I add the project to source control (GIT) for the first time, it shows all the files and everything is pretty peach. I can keep working for about 30 minutes to 1 hour with all changes showing up (any file changes I make). But after some time it shows

Git doesn't show changes even though file has changed

Alex Is git broken or are we doing something wrong? ;-) We found out that a file has changed in the latest version of the git repository and I am trying to figure out when it was used whatchanged. how so: $ git checkout 27773b72432e86d308d25d666663f237e50aa3fd

Git doesn't show changes even though file has changed

Alex Is git broken or are we doing something wrong? ;-) We found out that a file has changed in the latest version of the git repository and I am trying to figure out when it was used whatchanged. how so: $ git checkout 27773b72432e86d308d25d666663f237e50aa3fd

Git doesn't show changes even though file has changed

Alex Is git broken or are we doing something wrong? ;-) We found out that a file has changed in the latest version of the git repository and I am trying to figure out when it was used whatchanged. how so: $ git checkout 27773b72432e86d308d25d666663f237e50aa3fd

Git doesn't show committed changes or history for some files

Grand Slam Not sure if this is the answer as searching google or stack overflow has not helped so far (I may have used the wrong keyword). I'm new to using Git and have installed/tried Source-tree and Git Desktop to pull/push/commit from my git server. The pro

Git log pretty doesn't show yellow on Windows

mark I use PowerShell with posh-git. According to https://app.pluralsight.com/library/courses/git-advanced-tips-tricks/table-of-contents , the following command line git log --pretty='%Cred%h%Creset | %C(yellow)%d%Creset %s %Cgreen(%cr)%Creset %C(cyan)[%an]%Cr

git log --oneline command doesn't show recent commits

Nick Rinaldi I ran into an interesting problem at work the other day. So I'm a new data engineer and learning the ropes. I made a git commit of both files to the remote branch and created a PR, waiting to review the merge. However, my manager told me to cancel