All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] contrib/subtree: unwrap tag refs
@ 2015-11-13 17:25 Rob Mayoff
  2015-11-24 21:52 ` Jeff King
  0 siblings, 1 reply; 4+ messages in thread
From: Rob Mayoff @ 2015-11-13 17:25 UTC (permalink / raw)
  To: git; +Cc: Rob Mayoff

If a subtree was added using a tag ref, the tag ref is stored in
the subtree commit message instead of the underlying commit's ref.
To split or push subsequent changes to the subtree, the subtree
command needs to unwrap the tag ref.  This patch makes it do so.

The problem was described in a message to the mailing list from
Junio C Hamano dated 29 Apr 2014, with the subject "Re: git subtree
issue in more recent versions". The archived message can be found
at <http://comments.gmane.org/gmane.comp.version-control.git/247503>.

Signed-off-by: Rob Mayoff <mayoff@dqd.com>
---

changes since v1:

* remove obsolete sub assignments
* wrap lines

 contrib/subtree/git-subtree.sh | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/contrib/subtree/git-subtree.sh b/contrib/subtree/git-subtree.sh
index 9f06571..5ed0ea5 100755
--- a/contrib/subtree/git-subtree.sh
+++ b/contrib/subtree/git-subtree.sh
@@ -245,7 +245,10 @@ find_latest_squash()
 		case "$a" in
 			START) sq="$b" ;;
 			git-subtree-mainline:) main="$b" ;;
-			git-subtree-split:) sub="$b" ;;
+			git-subtree-split:)
+				sub="$(git rev-parse "$b^0")" ||
+				    die "could not rev-parse split hash $b from commit $sq"
+				;;
 			END)
 				if [ -n "$sub" ]; then
 					if [ -n "$main" ]; then
@@ -278,7 +281,10 @@ find_existing_splits()
 		case "$a" in
 			START) sq="$b" ;;
 			git-subtree-mainline:) main="$b" ;;
-			git-subtree-split:) sub="$b" ;;
+			git-subtree-split:)
+				sub="$(git rev-parse "$b^0")" ||
+				    die "could not rev-parse split hash $b from commit $sq"
+				;;
 			END)
 				debug "  Main is: '$main'"
 				if [ -z "$main" -a -n "$sub" ]; then
-- 
2.4.3

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] contrib/subtree: unwrap tag refs
  2015-11-13 17:25 [PATCH v2] contrib/subtree: unwrap tag refs Rob Mayoff
@ 2015-11-24 21:52 ` Jeff King
  2016-01-13  2:42   ` David A. Greene
  0 siblings, 1 reply; 4+ messages in thread
From: Jeff King @ 2015-11-24 21:52 UTC (permalink / raw)
  To: Rob Mayoff; +Cc: David A. Greene, git

On Fri, Nov 13, 2015 at 11:25:49AM -0600, Rob Mayoff wrote:

> If a subtree was added using a tag ref, the tag ref is stored in
> the subtree commit message instead of the underlying commit's ref.
> To split or push subsequent changes to the subtree, the subtree
> command needs to unwrap the tag ref.  This patch makes it do so.
> 
> The problem was described in a message to the mailing list from
> Junio C Hamano dated 29 Apr 2014, with the subject "Re: git subtree
> issue in more recent versions". The archived message can be found
> at <http://comments.gmane.org/gmane.comp.version-control.git/247503>.
> 
> Signed-off-by: Rob Mayoff <mayoff@dqd.com>
> ---
> 
> changes since v1:
> 
> * remove obsolete sub assignments
> * wrap lines

Thanks.  David, can I get an Ack on this?

-Peff

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] contrib/subtree: unwrap tag refs
  2015-11-24 21:52 ` Jeff King
@ 2016-01-13  2:42   ` David A. Greene
  2016-01-13 17:49     ` Junio C Hamano
  0 siblings, 1 reply; 4+ messages in thread
From: David A. Greene @ 2016-01-13  2:42 UTC (permalink / raw)
  To: Jeff King; +Cc: Rob Mayoff, git, gitster

Jeff King <peff@peff.net> writes:

> On Fri, Nov 13, 2015 at 11:25:49AM -0600, Rob Mayoff wrote:
>
>> If a subtree was added using a tag ref, the tag ref is stored in
>> the subtree commit message instead of the underlying commit's ref.
>> To split or push subsequent changes to the subtree, the subtree
>> command needs to unwrap the tag ref.  This patch makes it do so.
>> 
>> The problem was described in a message to the mailing list from
>> Junio C Hamano dated 29 Apr 2014, with the subject "Re: git subtree
>> issue in more recent versions". The archived message can be found
>> at <http://comments.gmane.org/gmane.comp.version-control.git/247503>.> 
>> Signed-off-by: Rob Mayoff <mayoff@dqd.com>
>> ---
>> 
>> changes since v1:
>> 
>> * remove obsolete sub assignments
>> * wrap lines
>
> Thanks.  David, can I get an Ack on this?

Yep.  I'm sorry I missed this re-roll.

                             -David

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] contrib/subtree: unwrap tag refs
  2016-01-13  2:42   ` David A. Greene
@ 2016-01-13 17:49     ` Junio C Hamano
  0 siblings, 0 replies; 4+ messages in thread
From: Junio C Hamano @ 2016-01-13 17:49 UTC (permalink / raw)
  To: David A. Greene; +Cc: Jeff King, Rob Mayoff, git

Thanks, all.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-01-13 17:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-13 17:25 [PATCH v2] contrib/subtree: unwrap tag refs Rob Mayoff
2015-11-24 21:52 ` Jeff King
2016-01-13  2:42   ` David A. Greene
2016-01-13 17:49     ` Junio C Hamano

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.