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

git log --ignore-space-change -L start,end:file does not ignore indentation changes

From
ДПДилян Палаузов <dilyan.palauzov@aegee.org>
Date
Apr 23, 2017, 06:08 UTC
Message-ID
<e18acd03-e10b-34b6-3883-bf91136bf299@aegee.org>
Hello,

$ git version git version 2.12.2.89.g49800c940

$ git init Initialized empty Git repository in .git/

$ cat a.c
int main() {
  int result;
}
$git add a.c
$git commit -m I
[master (root-commit) ef9ab63] I
  1 file changed, 3 insertions(+)
  create mode 100644 a.c
$cat a.c  # now the indentation of result changed
cat a.c
int main() {
    int result;
    return 0;
}
$git commit -am J
[master 1bed130] J
  1 file changed, 2 insertions(+), 1 deletion(-)

$git -oneline -b -L:main:a.c 1bed130 J

diff --git a/a.c b/a.c
--- a/a.c
+++ b/a.c
@@ -1,3 +1,4 @@
  int main() {
- int result;
+   int result;
+   return 0;
  }
ef9ab63 I

diff --git a/a.c b/a.c
--- /dev/null
+++ b/a.c
@@ -0,0 +1,3 @@
+int main() {
+ int result;
+}

I expect that the result-line is not displayed as changed, when git log 
is called with -b.

Likewise:
git log --oneline  -b -L2,2:a.c
1bed130 J

diff --git a/a.c b/a.c
--- a/a.c
+++ b/a.c
@@ -2,1 +2,1 @@
- int result;
+   int result;
ef9ab63 I

diff --git a/a.c b/a.c
--- /dev/null
+++ b/a.c
@@ -0,0 +2,1 @@
+ int result;

Regards
   Дилян
Message 1 of 1 in “git log --ignore-space-change -L start,end:file does not ignore indentation changes”
  1. Дилян ПалаузовApr 23, 2017

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.