Re: git diff: add option for omitting the contents of deletes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Mart Sõmermaa venit, vidit, dixit 28.02.2011 11:45:
> Why not just make it reversible then?
> 
> $ git diff -M
> diff --git a/foo b/bar
> similarity index 100%
> rename from foo
> rename to bar
> 
> is nonreversible without git already (i.e. does not work with plain
> patch AFAIK).

That "i.e." is a misunderstanding:

I'm sure Junio meant that "git apply -R" should make sense on a path
like that.

You can easily undo (reverse) a rename without knowing the file
contents; undeleting a file is more difficult :)

> Adding
> 
> $ git diff -D
> diff --git a/foo b/foo
> deleted file mode 100644
> delete foo
> 
> would be neither less nor more reversible -- it would also only work
> with git apply
> (assuming that apply is amended accordingly).

To reverse it, we would need the sah1 lines, and the repo would need
that blob.

> Cognitive burdens aside, the "delete foo" output is both
> more explicit and shorter anyway. Occam's razor FTW :)!

Yes.

> Junio, I won't push this further, so it's a final call -- if you give -1,
> then let -D fall to the colourless abyss of oblivion :), if +1 or +0,
> I'll see if I can come up with a patch.

You can always submit a patch, and you can never know what happens ;)

> Best regards,
> MS

Uhm, and please don't do that top post thing and the cc culling.
Readding J&J.

[quote snipped]
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]