* How to git diff files in renamed directories
@ 2012-03-15 8:32 Patrick Sabin
2012-03-15 8:51 ` Damien Wyart
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Patrick Sabin @ 2012-03-15 8:32 UTC (permalink / raw)
To: git
Hi,
I want to diff a renamed file (to a different directory) in different commits.
File a was moved to the file subdir/c
I tried:
$ git diff b616d 0aa0 -- subdir/c a
but git seems to always diff against /dev/null:
diff --git a/a b/a
new file mode 100644
index 0000000..2e5ada8
--- /dev/null
+++ b/a
@@ -0,0 +1 @@
+File a
diff --git a/subdir/c b/subdir/c
deleted file mode 100644
index 24c846c..0000000
--- a/subdir/c
+++ /dev/null
@@ -1,2 +0,0 @@
-File b
-Another b change.
git log --follow subdir/c recognizes that the file has been renamed
and moved to subdirectory.
Is there any way to get such a diff in git?
Regards,
Patrick
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: How to git diff files in renamed directories
2012-03-15 8:32 How to git diff files in renamed directories Patrick Sabin
@ 2012-03-15 8:51 ` Damien Wyart
2012-03-15 10:30 ` Neal Kreitzinger
2012-03-15 20:49 ` Junio C Hamano
2 siblings, 0 replies; 4+ messages in thread
From: Damien Wyart @ 2012-03-15 8:51 UTC (permalink / raw)
To: Patrick Sabin; +Cc: git
Hi,
* Patrick Sabin <patrick.just4fun@gmail.com> [2012-03-15 09:32]:
> I want to diff a renamed file (to a different directory) in different
> commits.
You can try the "-C" option to git diff. In some cases, "-C -C" might be
needed (with potentially bad performance).
--
Damien
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: How to git diff files in renamed directories
2012-03-15 8:32 How to git diff files in renamed directories Patrick Sabin
2012-03-15 8:51 ` Damien Wyart
@ 2012-03-15 10:30 ` Neal Kreitzinger
2012-03-15 20:49 ` Junio C Hamano
2 siblings, 0 replies; 4+ messages in thread
From: Neal Kreitzinger @ 2012-03-15 10:30 UTC (permalink / raw)
To: Patrick Sabin; +Cc: git
On 3/15/2012 3:32 AM, Patrick Sabin wrote:
>
> I want to diff a renamed file (to a different directory) in different commits.
>
> File a was moved to the file subdir/c
>
> I tried:
>
> $ git diff b616d 0aa0 -- subdir/c a
>
> but git seems to always diff against /dev/null:
>
> diff --git a/a b/a
> new file mode 100644
> index 0000000..2e5ada8
> --- /dev/null
> +++ b/a
> @@ -0,0 +1 @@
> +File a
> diff --git a/subdir/c b/subdir/c
> deleted file mode 100644
> index 24c846c..0000000
> --- a/subdir/c
> +++ /dev/null
> @@ -1,2 +0,0 @@
> -File b
> -Another b change.
>
> git log --follow subdir/c recognizes that the file has been renamed
> and moved to subdirectory.
>
> Is there any way to get such a diff in git?
>
git diff b616d:a 0aa0:subdir/c is one way to do it.
v/r,
neal
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: How to git diff files in renamed directories
2012-03-15 8:32 How to git diff files in renamed directories Patrick Sabin
2012-03-15 8:51 ` Damien Wyart
2012-03-15 10:30 ` Neal Kreitzinger
@ 2012-03-15 20:49 ` Junio C Hamano
2 siblings, 0 replies; 4+ messages in thread
From: Junio C Hamano @ 2012-03-15 20:49 UTC (permalink / raw)
To: Patrick Sabin; +Cc: git
Patrick Sabin <patrick.just4fun@gmail.com> writes:
> I want to diff a renamed file (to a different directory) in different commits.
>
> File a was moved to the file subdir/c
>
> I tried:
>
> $ git diff b616d 0aa0 -- subdir/c a
Does
$ git diff -M b616d 0aa0 -- subdir/c a
match them up?
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-03-15 20:49 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-15 8:32 How to git diff files in renamed directories Patrick Sabin
2012-03-15 8:51 ` Damien Wyart
2012-03-15 10:30 ` Neal Kreitzinger
2012-03-15 20:49 ` Junio C Hamano
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 NNTP newsgroup(s).