All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Parkins <andyparkins@gmail.com>
To: git@vger.kernel.org
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
	Junio C Hamano <junkio@cox.net>
Subject: Re: Expose subprojects as special files to "git diff" machinery
Date: Sun, 15 Apr 2007 21:16:23 +0100	[thread overview]
Message-ID: <200704152116.26773.andyparkins@gmail.com> (raw)
In-Reply-To: <Pine.LNX.4.64.0704151100550.5473@woody.linux-foundation.org>

On Sunday 2007, April 15, Linus Torvalds wrote:

> 	diff --git a/sub-A b/sub-A
> 	index 2de597b..e8f11a4 160000
> 	--- a/sub-A
> 	+++ b/sub-A
> 	@@ -1 +1 @@
> 	-Subproject commit 2de597b5ad348b7db04bd10cdd38cd81cbc93ab5
> 	+Subproject commit e8f11a45c5c6b9e2fec6d136d3fb5aff75393d42

Isn't this dangerous because it looks just like a normal diff with a 
file being rewritten, when in truth it is a tree entry record being 
rewritten.  Possibly this is in the same category as the enhancements 
needed for rename support

cf.

diff --git a/file1 b/file2
similarity index 100%
rename from file1
rename to file2

There's no need to have a line marker, as there is only one "line" in 
the subproject "file", and no need for the index line because that 
information is contained in the change itself.  So something like:

diff --git a/sub-A b/sub-B
subproject from commit 2de597b5ad348b7db04bd10cdd38cd81cbc93ab5
subproject to commit e8f11a45c5c6b9e2fec6d136d3fb5aff75393d42

Regardless of the format, I'm sure this should be treated as part of 
git's extended diff syntax, so that if a diff like this ever got into 
the wild it wouldn't be a disaster if someone tried to apply it.



Andy
-- 
Dr Andy Parkins, M Eng (hons), MIET
andyparkins@gmail.com

  parent reply	other threads:[~2007-04-15 20:16 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-15 18:14 Expose subprojects as special files to "git diff" machinery Linus Torvalds
2007-04-15 19:01 ` Sam Ravnborg
2007-04-15 19:05   ` Linus Torvalds
2007-04-15 19:20     ` Sam Ravnborg
2007-04-15 20:16 ` Andy Parkins [this message]
2007-04-15 21:03   ` Linus Torvalds
2007-04-18  8:46     ` git-format-patch for binary files / merges [Re: Expose subprojects as special files to "git diff" machinery] Sam Vilain
2007-04-18 11:49       ` Alex Riesen
2007-04-18 11:52       ` Johannes Schindelin
2007-04-18 15:47       ` Linus Torvalds
2007-04-18 16:08         ` Junio C Hamano
2007-04-19  8:28         ` Johannes Schindelin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200704152116.26773.andyparkins@gmail.com \
    --to=andyparkins@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=junkio@cox.net \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.