# Bug in diff header generation

2 messages from 2007-03-02 to 2007-03-02. Participants: Matthias Kestenholz, Johannes Schindelin.
Thread: https://gitlist.dev/t/7050

## Matthias Kestenholz, 2007-03-02 12:53

Subject: Bug in diff header generation
Message-ID: <1172840031.22581.3.camel@localhost.localdomain>
URL: https://gitlist.dev/e/1172840031.22581.3.camel%40localhost.localdomain

```
Hello,

I've encountered a small error in the diff header generation when
diffing against files which are not tracked by git:


[13:49] mk@crap ~/Projects/git > git diff git.c ~/bin/viname|head
diff --git a/git.c b/home/mk/bin/viname
old mode 100644
new mode 100755
index 008e016..b64857e
--- a/git.c
+++ b/home/mk/bin/viname
@@ -1,416 +1,106 @@
-#include "builtin.h"
-#include "exec_cmd.h"
-#include "cache.h"
[13:49] mk@crap ~/Projects/git > git diff HEAD:git.c ~/bin/viname|head
diff --git a/home/mk/bin/viname b/home/mk/bin/viname
index 008e016..b64857e 100755
--- a/home/mk/bin/viname
+++ b/home/mk/bin/viname
@@ -1,416 +1,106 @@
-#include "builtin.h"
-#include "exec_cmd.h"
-#include "cache.h"
-#include "quote.h"
-


When a revision is specified, git-diff prints a/home/mk/bin/viname
instead of a/git.c

Because of my final exams I've got no time to look into it right now.


Matthias

```

## Johannes Schindelin, 2007-03-02 22:05

Subject: Re: Bug in diff header generation
Message-ID: <Pine.LNX.4.63.0703022254320.22628@wbgn013.biozentrum.uni-wuerzburg.de>
URL: https://gitlist.dev/e/Pine.LNX.4.63.0703022254320.22628%40wbgn013.biozentrum.uni-wuerzburg.de
In-Reply-To: <1172840031.22581.3.camel@localhost.localdomain>

```
Hi,

On Fri, 2 Mar 2007, Matthias Kestenholz wrote:

> [13:49] mk@crap ~/Projects/git > git diff HEAD:git.c ~/bin/viname|head
> diff --git a/home/mk/bin/viname b/home/mk/bin/viname

This is intended behaviour. You don't want a Git object name as a file 
specifier, because you cannot edit a Git object.

Hth,
Dscho

```
