I have looked at many explanations about what git diff between 2 commits does, and I am still completely baffled about the output I am getting. I believe what I am seeing is "combined format", said to be the "default" format, but if so I don't know what other formats are available.
Example:
>git diff af738ab0..bbbec26d > gitdiff_2025-04-09B.diff
Typically I get this kind of thing:
...
+diff --git a/src/core/history_table_view.py b/src/core/history_table_view.py
+index 5b18236..05b262a 100644
+--- a/src/core/history_table_view.py
++++ b/src/core/history_table_view.py
+@@ -14,188 +14,279 @@ class HistoryTableView(QtWidgets.QTableView):
+ @thread_check(True)
+ def __init__(self, *args):
+ super().__init__(*args)
+- self.setObjectName('history table')
+- self.setSelectionMode(QtWidgets.QAbstractItemView.SingleSelection)
+- self.horizontalHeader().setStretchLastSection(True)
+- self.horizontalHeader().hide()
+- self.verticalHeader().hide()
+- self.setModel(HistoryTableModel(self))
...
... in this part of the output it is comparing the file history_table_view.py in the first commit with the same file in the second commit.
All the above lines are present in both files. So why might this line
+ def __init__(self, *args):
start with a simple "+", whereas this line
+- self.setObjectName('history table')
starts with "+-"? What does this mean? As I say both lines are present in both versions of this file. I would expect a git diff in principle not to show any of these lines (although there are some differences in terms of empty lines between the lines with text).
Secondly, when I look at a simple intro to git diff, such as this, the presenter there does a git diff on 2 commits, at 4:40 into that video we see output ... but in his case he is NOT seeing double symbols at the start of lines, but simple "+" or "-", i.e. as far as I understand it what one might expect from a BASH diff command done between two files. THAT SIMPLE FORMAT IS ALL I WANT.
I suspect that there may be an alternative to git diff "combined format" which does indeed produce this simpler output, but I haven't been able to find it. Secondly, the video I reference above was made 7 months ago: why is that Youtuber getting by default, when comparing 2 commits, simple git output (which is perfectly comprehensible to me), while I'm getting (to me) incomprehensible output? My git version is:
git version 2.48.1.windows.1
A simple link to a page which genuinely explains this specific business of git diff comparing 2 commits, in clear terms, and crucially showing how to get a simple diff, might be all I need. I have searched long and hard and not found.
Later.
Can the daoh-nvohter please say why this question is not worthy of being asked?
+/-sign shows how that line is seen from each parent of the merge commit. Now, why do you see that in plaindiff, I don't know.src/core/history_table_view.pyhas those lines starting with-in commitbbbec26d.... is that the case?git diff a b > file.diff, and later you didgit add .; git commit, and now you are showing us the result ofgit diff a c, wherecis the commit you just made.+diff --git a/src/core/his...the line mentioning that file also starts with a+. Go higher into your diff (to the nearest line which starts withdiff ...without a leading+or-) to get the name of the culprit patch file.git grep -l -e "^diff --git" bbbec26d