{"thread":{"id":"12272","subject":"[PATCH] Add merge-subtree back","startedAt":"2008-02-23T19:16:21Z","lastAt":"2008-02-28T14:57:44Z","messageCount":6,"participants":["Junio C Hamano","Daniel Barkalow","Miklos Vajna","Johannes Schindelin"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"69696","messageId":"7vprun32m2.fsf@gitster.siamese.dyndns.org","threadId":"12272","inReplyTo":null,"subject":"[PATCH] Add merge-subtree back","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-02-23T19:16:21Z","receivedAt":"2008-02-23T19:16:21Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"An earlier commit e1b3a2c (Build-in merge-recursive) made the\nsubtree merge strategy backend unavailable.  This resurrects\nit.\n\nA new test t6029 currently only tests the strategy is available,\nbut it should be enhanced to check the real \"subtree\" case.\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n Makefile                 |    8 +++-----\n git.c                    |    1 +\n t/t6029-merge-subtree.sh |   32 ++++++++++++++++++++++++++++++++\n 3 files changed, 36 insertions(+), 5 deletions(-)\n create mode 100755 t/t6029-merge-subtree.sh\n\ndiff --git a/Makefile b/Makefile\nindex 90c0dd8..40fa41b 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -261,17 +261,18 @@ PROGRAMS = \\\n # Empty...\n EXTRA_PROGRAMS =\n \n+# List built-in command $C whose implementation cmd_$C() is not in\n+# builtin-$C.o but is linked in as part of some other command.\n BUILT_INS = \\\n \tgit-format-patch$X git-show$X git-whatchanged$X git-cherry$X \\\n \tgit-get-tar-commit-id$X git-init$X git-repo-config$X \\\n \tgit-fsck-objects$X git-cherry-pick$X git-peek-remote$X git-status$X \\\n+\tgit-merge-subtree$X \\\n \t$(patsubst builtin-%.o,git-%$X,$(BUILTIN_OBJS))\n \n # what 'all' will build and 'install' will install, in gitexecdir\n ALL_PROGRAMS = $(PROGRAMS) $(SCRIPTS)\n \n-ALL_PROGRAMS += git-merge-subtree$X\n-\n # what 'all' will build but not install in gitexecdir\n OTHER_PROGRAMS = git$X gitweb/gitweb.cgi\n \n@@ -807,9 +808,6 @@ help.o: help.c common-cmds.h GIT-CFLAGS\n \t\t'-DGIT_MAN_PATH=\"$(mandir_SQ)\"' \\\n \t\t'-DGIT_INFO_PATH=\"$(infodir_SQ)\"' $<\n \n-git-merge-subtree$X: git-merge-recursive$X\n-\t$(QUIET_BUILT_IN)$(RM) $@ && ln git-merge-recursive$X $@\n-\n $(BUILT_INS): git$X\n \t$(QUIET_BUILT_IN)$(RM) $@ && ln git$X $@\n \ndiff --git a/git.c b/git.c\nindex fc15686..bd424ea 100644\n--- a/git.c\n+++ b/git.c\n@@ -332,6 +332,7 @@ static void handle_internal_command(int argc, const char **argv)\n \t\t{ \"merge-file\", cmd_merge_file },\n \t\t{ \"merge-ours\", cmd_merge_ours, RUN_SETUP },\n \t\t{ \"merge-recursive\", cmd_merge_recursive, RUN_SETUP | NEED_WORK_TREE },\n+\t\t{ \"merge-subtree\", cmd_merge_recursive, RUN_SETUP | NEED_WORK_TREE },\n \t\t{ \"mv\", cmd_mv, RUN_SETUP | NEED_WORK_TREE },\n \t\t{ \"name-rev\", cmd_name_rev, RUN_SETUP },\n \t\t{ \"pack-objects\", cmd_pack_objects, RUN_SETUP },\ndiff --git a/t/t6029-merge-subtree.sh b/t/t6029-merge-subtree.sh\nnew file mode 100755\nindex 0000000..3900a05\n--- /dev/null\n+++ b/t/t6029-merge-subtree.sh\n@@ -0,0 +1,32 @@\n+#!/bin/sh\n+\n+test_description='subtree merge strategy'\n+\n+. ./test-lib.sh\n+\n+test_expect_success setup '\n+\n+\ts=\"1 2 3 4 5 6 7 8\"\n+\tfor i in $s; do echo $i; done >hello &&\n+\tgit add hello &&\n+\tgit commit -m initial &&\n+\tgit checkout -b side &&\n+\techo >>hello world &&\n+\tgit add hello &&\n+\tgit commit -m second &&\n+\tgit checkout master &&\n+\tfor i in mundo $s; do echo $i; done >hello &&\n+\tgit add hello &&\n+\tgit commit -m master\n+\n+'\n+\n+test_expect_success 'subtree available and works like recursive' '\n+\n+\tgit merge -s subtree side &&\n+\tfor i in mundo $s world; do echo $i; done >expect &&\n+\tdiff -u expect hello\n+\n+'\n+\n+test_done\n-- \n1.5.4.2.300.g8d945\n"},{"id":"69760","messageId":"alpine.LNX.1.00.0802240040010.19024@iabervon.org","threadId":"12272","inReplyTo":"7vprun32m2.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] Add merge-subtree back","fromName":"Daniel Barkalow","fromEmail":"barkalow@iabervon.org","sentAt":"2008-02-24T06:19:55Z","receivedAt":"2008-02-24T06:19:55Z","isPatch":true,"sender":{"key":"barkalow@iabervon.org","avatar":"https://avatars.githubusercontent.com/u/55364219?v=4"},"body":"On Sat, 23 Feb 2008, Junio C Hamano wrote:\n\n> An earlier commit e1b3a2c (Build-in merge-recursive) made the\n> subtree merge strategy backend unavailable.  This resurrects\n> it.\n\nThat's really quite subtle. I think there should probably be a \ncmd_merge_subtree that shares almost everything with cmd_merge_recursive, \nbut is a different function.\n\nOr maybe there should be a \"--subtree\" option to merge that has that \neffect with arbitrary stratgeies by changing what gets sent to the \nstrategy.\n\nBut restoring access to the strategy for now is obviously fine.\n\n\t-Daniel\n*This .sig left intentionally blank*\n"},{"id":"70195","messageId":"20080228015122.GB31441@genesis.frugalware.org","threadId":"12272","inReplyTo":"7vprun32m2.fsf@gitster.siamese.dyndns.org","subject":"[PATCH] New test to check the real \"subtree\" case","fromName":"Miklos Vajna","fromEmail":"vmiklos@frugalware.org","sentAt":"2008-02-28T01:51:22Z","receivedAt":"2008-02-28T01:51:22Z","isPatch":true,"sender":{"key":"vmiklos@frugalware.org","avatar":"https://gravatar.com/avatar/401c1cbbb3a5d13e650c691a2c71d6fd0b80df1a01bc74d9f1972675dd58f2bd?d=mp&s=160"},"body":"t6029 already checks if subtree available and works like recursive, but\nthis new one actually tests the extra functionality the subtree merge\nstrategy provides.\n\nSigned-off-by: Miklos Vajna <vmiklos@frugalware.org>\n---\n\nOn Sat, Feb 23, 2008 at 11:16:21AM -0800, Junio C Hamano <gitster@pobox.com> wrote:\n> A new test t6029 currently only tests the strategy is available,\n> but it should be enhanced to check the real \"subtree\" case.\n\ni think something like this should do it.\n\n t/t3035-merge-subtree.sh |   54 ++++++++++++++++++++++++++++++++++++++++++++++\n 1 files changed, 54 insertions(+), 0 deletions(-)\n create mode 100755 t/t3035-merge-subtree.sh\n\ndiff --git a/t/t3035-merge-subtree.sh b/t/t3035-merge-subtree.sh\nnew file mode 100755\nindex 0000000..e400dce\n--- /dev/null\n+++ b/t/t3035-merge-subtree.sh\n@@ -0,0 +1,54 @@\n+#!/bin/sh\n+\n+test_description='merge-subtree backend test'\n+\n+. ./test-lib.sh\n+\n+test_expect_success 'setup' '\n+\tmkdir git-gui &&\n+\tcd git-gui &&\n+\tgit init &&\n+\techo git-gui > git-gui.sh &&\n+\to1=$(git hash-object git-gui.sh) &&\n+\tgit add git-gui.sh &&\n+\tgit commit -m \"initial git-gui\" &&\n+\tcd .. &&\n+\tmkdir git &&\n+\tcd git &&\n+\tgit init &&\n+\techo git >git.c &&\n+\to2=$(git hash-object git.c) &&\n+\tgit add git.c &&\n+\tgit commit -m \"initial git\"\n+'\n+\n+test_expect_success 'initial merge' '\n+\tgit remote add -f gui ../git-gui &&\n+\tgit merge -s ours --no-commit gui/master &&\n+\tgit read-tree --prefix=git-gui/ -u gui/master &&\n+\tgit commit -m \"Merge git-gui as our subdirectory\" &&\n+\tgit ls-files -s >actual &&\n+\t(\n+\t\techo \"100644 $o1 0\tgit-gui/git-gui.sh\"\n+\t\techo \"100644 $o2 0\tgit.c\"\n+\t) >expected &&\n+\tgit diff -u expected actual\n+'\n+\n+test_expect_success 'merge update' '\n+\tcd ../git-gui &&\n+\techo git-gui2 > git-gui.sh &&\n+\to3=$(git hash-object git-gui.sh) &&\n+\tgit add git-gui.sh &&\n+\tgit commit -m \"update git-gui\" &&\n+\tcd ../git &&\n+\tgit pull -s subtree gui master &&\n+\tgit ls-files -s >actual &&\n+\t(\n+\t\techo \"100644 $o3 0\tgit-gui/git-gui.sh\"\n+\t\techo \"100644 $o2 0\tgit.c\"\n+\t) >expected &&\n+\tgit diff -u expected actual\n+'\n+\n+test_done\n-- \n1.5.4.3\n"},{"id":"70230","messageId":"alpine.LSU.1.00.0802280944110.22527@racer.site","threadId":"12272","inReplyTo":"20080228015122.GB31441@genesis.frugalware.org","subject":"Re: [PATCH] New test to check the real \"subtree\" case","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-02-28T09:45:03Z","receivedAt":"2008-02-28T09:45:03Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Thu, 28 Feb 2008, Miklos Vajna wrote:\n\n> On Sat, Feb 23, 2008 at 11:16:21AM -0800, Junio C Hamano <gitster@pobox.com> wrote:\n> > A new test t6029 currently only tests the strategy is available,\n> > but it should be enhanced to check the real \"subtree\" case.\n> \n> i think something like this should do it.\n> \n>  t/t3035-merge-subtree.sh |   54 ++++++++++++++++++++++++++++++++++++++++++++++\n\nWhy yet another file?  Why not enhance t6029, as suggested?\n\nCiao,\nDscho\n"},{"id":"70249","messageId":"20080228123654.GE31441@genesis.frugalware.org","threadId":"12272","inReplyTo":"alpine.LSU.1.00.0802280944110.22527@racer.site","subject":"[PATCH] Improve t6029 to check the real \"subtree\" case","fromName":"Miklos Vajna","fromEmail":"vmiklos@frugalware.org","sentAt":"2008-02-28T12:36:54Z","receivedAt":"2008-02-28T12:36:54Z","isPatch":true,"sender":{"key":"vmiklos@frugalware.org","avatar":"https://gravatar.com/avatar/401c1cbbb3a5d13e650c691a2c71d6fd0b80df1a01bc74d9f1972675dd58f2bd?d=mp&s=160"},"body":"t6029 already checks if subtree available and works like recursive. This\npatch adds code to test test the extra functionality the subtree merge\nstrategy provides.\n\nSigned-off-by: Miklos Vajna <vmiklos@frugalware.org>\n---\n\nOn Thu, Feb 28, 2008 at 09:45:03AM +0000, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:\n> Why yet another file?  Why not enhance t6029, as suggested?\n\nhere it is.\n\n t/t6029-merge-subtree.sh |   47 ++++++++++++++++++++++++++++++++++++++++++++++\n 1 files changed, 47 insertions(+), 0 deletions(-)\n\ndiff --git a/t/t6029-merge-subtree.sh b/t/t6029-merge-subtree.sh\nindex 3900a05..35d66e8 100755\n--- a/t/t6029-merge-subtree.sh\n+++ b/t/t6029-merge-subtree.sh\n@@ -29,4 +29,51 @@ test_expect_success 'subtree available and works like recursive' '\n \n '\n \n+test_expect_success 'setup' '\n+\tmkdir git-gui &&\n+\tcd git-gui &&\n+\tgit init &&\n+\techo git-gui > git-gui.sh &&\n+\to1=$(git hash-object git-gui.sh) &&\n+\tgit add git-gui.sh &&\n+\tgit commit -m \"initial git-gui\" &&\n+\tcd .. &&\n+\tmkdir git &&\n+\tcd git &&\n+\tgit init &&\n+\techo git >git.c &&\n+\to2=$(git hash-object git.c) &&\n+\tgit add git.c &&\n+\tgit commit -m \"initial git\"\n+'\n+\n+test_expect_success 'initial merge' '\n+\tgit remote add -f gui ../git-gui &&\n+\tgit merge -s ours --no-commit gui/master &&\n+\tgit read-tree --prefix=git-gui/ -u gui/master &&\n+\tgit commit -m \"Merge git-gui as our subdirectory\" &&\n+\tgit ls-files -s >actual &&\n+\t(\n+\t\techo \"100644 $o1 0\tgit-gui/git-gui.sh\"\n+\t\techo \"100644 $o2 0\tgit.c\"\n+\t) >expected &&\n+\tgit diff -u expected actual\n+'\n+\n+test_expect_success 'merge update' '\n+\tcd ../git-gui &&\n+\techo git-gui2 > git-gui.sh &&\n+\to3=$(git hash-object git-gui.sh) &&\n+\tgit add git-gui.sh &&\n+\tgit commit -m \"update git-gui\" &&\n+\tcd ../git &&\n+\tgit pull -s subtree gui master &&\n+\tgit ls-files -s >actual &&\n+\t(\n+\t\techo \"100644 $o3 0\tgit-gui/git-gui.sh\"\n+\t\techo \"100644 $o2 0\tgit.c\"\n+\t) >expected &&\n+\tgit diff -u expected actual\n+'\n+\n test_done\n-- \n1.5.4\n"},{"id":"70260","messageId":"alpine.LSU.1.00.0802281456550.22527@racer.site","threadId":"12272","inReplyTo":"20080228123654.GE31441@genesis.frugalware.org","subject":"Re: [PATCH] Improve t6029 to check the real \"subtree\" case","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-02-28T14:57:44Z","receivedAt":"2008-02-28T14:57:44Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Thu, 28 Feb 2008, Miklos Vajna wrote:\n\n> On Thu, Feb 28, 2008 at 09:45:03AM +0000, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:\n> > Why yet another file?  Why not enhance t6029, as suggested?\n> \n> here it is.\n\nThanks.\n\n> diff --git a/t/t6029-merge-subtree.sh b/t/t6029-merge-subtree.sh\n> index 3900a05..35d66e8 100755\n> --- a/t/t6029-merge-subtree.sh\n> +++ b/t/t6029-merge-subtree.sh\n> @@ -29,4 +29,51 @@ test_expect_success 'subtree available and works like recursive' '\n>  \n>  '\n>  \n> +test_expect_success 'setup' '\n\nI'd call this 'setup subproject', but that's just nitpicking.\n\nCiao,\nDscho\n"}]}