{"thread":{"id":"18958","subject":"[PATCH/RESEND] git-submodule: add support for --rebase.","startedAt":"2009-04-19T23:31:00Z","lastAt":"2009-04-24T16:19:21Z","messageCount":9,"participants":["Peter Hutterer","Johannes Schindelin","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"111666","messageId":"20090419233051.GA17946@dingo.bne.redhat.com","threadId":"18958","inReplyTo":null,"subject":"[PATCH/RESEND] git-submodule: add support for --rebase.","fromName":"Peter Hutterer","fromEmail":"peter.hutterer@who-t.net","sentAt":"2009-04-19T23:31:00Z","receivedAt":"2009-04-19T23:31:00Z","isPatch":true,"sender":{"key":"peter.hutterer@who-t.net","avatar":"https://avatars.githubusercontent.com/u/1487352?v=4"},"body":"'git submodule update --rebase' rebases your local branch on top of what would\nhave been checked out to a detached HEAD otherwise.\n\nIn some cases, detaching the HEAD when updating a submodule complicates the\nworkflow to commit to this submodule (checkout master, rebase, then commit).\nFor submodules that require frequent updates but infrequent (if any) commits,\na rebase can be executed directly by the git-submodule command, ensuring that\nthe submodules stay on their respective branches.\n\nSigned-off-by: Peter Hutterer <peter.hutterer@who-t.net>\n---\n\nPrevious thread:\nhttp://thread.gmane.org/gmane.comp.version-control.git/115950/focus=116076\n\nOriginal thread died after discussions about the wording in the man page, last\nreviewer comment being:\n\"You can really rebase only onto a commit.  And the index is not a commit, so\nI do not like the wording (not even in the rebase man page).\n\nBut let's see what other reviewers say... :-)\"\n\nI'm still unsure about whether to change the wording (it currently uses the\nsame terms as git-rebase and the rest of the git-submodule man page). Please\nlet me know what to do to get this patch done.\n\n Documentation/git-submodule.txt |   12 +++++-\n git-submodule.sh                |   22 +++++++++--\n t/t7404-submodule-update.sh     |   79 +++++++++++++++++++++++++++++++++++++++\n 3 files changed, 107 insertions(+), 6 deletions(-)\n create mode 100755 t/t7404-submodule-update.sh\n\ndiff --git a/Documentation/git-submodule.txt b/Documentation/git-submodule.txt\nindex 3b8df44..7e0dcb1 100644\n--- a/Documentation/git-submodule.txt\n+++ b/Documentation/git-submodule.txt\n@@ -12,7 +12,7 @@ SYNOPSIS\n 'git submodule' [--quiet] add [-b branch] [--] <repository> <path>\n 'git submodule' [--quiet] status [--cached] [--] [<path>...]\n 'git submodule' [--quiet] init [--] [<path>...]\n-'git submodule' [--quiet] update [--init] [-N|--no-fetch] [--] [<path>...]\n+'git submodule' [--quiet] update [--init] [-N|--no-fetch] [--rebase] [--] [<path>...]\n 'git submodule' [--quiet] summary [--summary-limit <n>] [commit] [--] [<path>...]\n 'git submodule' [--quiet] foreach <command>\n 'git submodule' [--quiet] sync [--] [<path>...]\n@@ -113,7 +113,8 @@ init::\n update::\n \tUpdate the registered submodules, i.e. clone missing submodules and\n \tcheckout the commit specified in the index of the containing repository.\n-\tThis will make the submodules HEAD be detached.\n+\tThis will make the submodules HEAD be detached unless '--rebase' is\n+\tspecified.\n +\n If the submodule is not yet initialized, and you just want to use the\n setting as stored in .gitmodules, you can automatically initialize the\n@@ -177,6 +178,13 @@ OPTIONS\n \tThis option is only valid for the update command.\n \tDon't fetch new objects from the remote site.\n \n+--rebase::\n+\tThis option is only valid for the update command.\n+\tRebase the current branch onto the index of the containing repository\n+\tinstead of detaching the HEAD.\n+\tIf a a merge failure prevents this process, you will have to resolve\n+\tthese failures with linkgit:git-rebase[1].\n+\n <path>...::\n \tPaths to submodule(s). When specified this will restrict the command\n \tto only operate on the submodules found at the specified paths.\ndiff --git a/git-submodule.sh b/git-submodule.sh\nindex 7c2e060..e2d40ee 100755\n--- a/git-submodule.sh\n+++ b/git-submodule.sh\n@@ -17,6 +17,7 @@ branch=\n quiet=\n cached=\n nofetch=\n+rebase=\n \n #\n # print stuff on stdout unless -q was specified\n@@ -314,6 +315,10 @@ cmd_update()\n \t\t\tshift\n \t\t\tnofetch=1\n \t\t\t;;\n+\t\t-r|--rebase)\n+\t\t\tshift\n+\t\t\trebase=1\n+\t\t\t;;\n \t\t--)\n \t\t\tshift\n \t\t\tbreak\n@@ -367,11 +372,20 @@ cmd_update()\n \t\t\t\tdie \"Unable to fetch in submodule path '$path'\"\n \t\t\tfi\n \n-\t\t\t(unset GIT_DIR; cd \"$path\" &&\n-\t\t\t\t  git-checkout $force -q \"$sha1\") ||\n-\t\t\tdie \"Unable to checkout '$sha1' in submodule path '$path'\"\n+\t\t\tif test -z \"$rebase\"\n+\t\t\tthen\n+\t\t\t\tcommand=\"git-checkout $force -q\"\n+\t\t\t\taction=\"checkout\"\n+\t\t\t\tmsg=\"checked out\"\n+\t\t\telse\n+\t\t\t\tcommand=\"git-rebase\"\n+\t\t\t\taction=\"rebase\"\n+\t\t\t\tmsg=\"rebased onto\"\n+\t\t\tfi\n \n-\t\t\tsay \"Submodule path '$path': checked out '$sha1'\"\n+\t\t\t(unset GIT_DIR; cd \"$path\" && $command \"$sha1\") ||\n+\t\t\tdie \"Unable to $action '$sha1' in submodule path '$path'\"\n+\t\t\tsay \"Submodule path '$path': $msg '$sha1'\"\n \t\tfi\n \tdone\n }\ndiff --git a/t/t7404-submodule-update.sh b/t/t7404-submodule-update.sh\nnew file mode 100755\nindex 0000000..20cc093\n--- /dev/null\n+++ b/t/t7404-submodule-update.sh\n@@ -0,0 +1,79 @@\n+#!/bin/sh\n+#\n+# Copyright (c) 2009 Red Hat, Inc.\n+#\n+\n+test_description='Test updating submodules\n+\n+This test verifies that \"git submodule update\" detaches the HEAD of the\n+submodule and \"git submodule update --rebase\" does not detach the HEAD.\n+'\n+\n+. ./test-lib.sh\n+\n+\n+compare_head()\n+{\n+    sha_master=`git-rev-list --max-count=1 master`\n+    sha_head=`git-rev-list --max-count=1 HEAD`\n+\n+    test \"$sha_master\" = \"$sha_head\"\n+}\n+\n+\n+test_expect_success 'setup a submodule tree' '\n+\techo file > file &&\n+\tgit add file &&\n+\ttest_tick &&\n+\tgit commit -m upstream\n+\tgit clone . super &&\n+\tgit clone super submodule &&\n+\t(cd super &&\n+\t git submodule add ../submodule submodule &&\n+\t test_tick &&\n+\t git commit -m \"submodule\" &&\n+\t git submodule init submodule\n+\t) &&\n+\t(cd submodule &&\n+\techo \"line2\" > file &&\n+\tgit add file &&\n+\tgit commit -m \"Commit 2\"\n+\t) &&\n+\t(cd super &&\n+\t (cd submodule &&\n+\t  git pull --rebase origin\n+\t ) &&\n+\t git add submodule &&\n+\t git commit -m \"submodule update\"\n+\t)\n+'\n+\n+test_expect_success 'submodule update detaching the HEAD ' '\n+\t(cd super/submodule &&\n+\t git reset --hard HEAD~1\n+\t) &&\n+\t(cd super &&\n+\t (cd submodule &&\n+\t  compare_head\n+\t ) &&\n+\t git submodule update submodule &&\n+\t cd submodule &&\n+\t ! compare_head\n+\t)\n+'\n+\n+test_expect_success 'submodule update --rebase staying on master' '\n+\t(cd super/submodule &&\n+\t  git checkout master\n+\t) &&\n+\t(cd super &&\n+\t (cd submodule &&\n+\t  compare_head\n+\t ) &&\n+\t git submodule update --rebase submodule &&\n+\t cd submodule &&\n+\t compare_head\n+\t)\n+'\n+\n+test_done\n-- \n1.6.2.2.447.g4afa7\n"},{"id":"111705","messageId":"alpine.DEB.1.00.0904201152360.6955@intel-tinevez-2-302","threadId":"18958","inReplyTo":"20090419233051.GA17946@dingo.bne.redhat.com","subject":"Re: [PATCH/RESEND] git-submodule: add support for --rebase.","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2009-04-20T09:55:54Z","receivedAt":"2009-04-20T09:55:54Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Mon, 20 Apr 2009, Peter Hutterer wrote:\n\n> 'git submodule update --rebase' rebases your local branch on top of what would\n\nThis line is so long that it got wrapped in my mail program.  But it is \neven worse: we would like to show this in an 80-column display with a \n4-space indent, so it would be nice if you could rewrap to 76 columns (I \neven use 72 columns, because it looks nicer).\n\n> Original thread died after discussions about the wording in the man \n> page, last reviewer comment being:\n>\n> \"You can really rebase only onto a commit.  And the index is not a \n> commit, so I do not like the wording (not even in the rebase man page).\n> \n> But let's see what other reviewers say... :-)\"\n\nI take this as a sign that other reviewers (if any) agree with me ;-)\n\n> I'm still unsure about whether to change the wording (it currently uses \n> the same terms as git-rebase and the rest of the git-submodule man \n> page). Please let me know what to do to get this patch done.\n\nAFAIR I gave an alternative wording, am I wrong?\n\nSo I'd prefer a repost with rewrapped commit message and reworded man page \nmodifications.\n\nHowever, I could imagine that Junio does not want to take this patch right \nnow, as we are deep in -rc mode for the upcoming 1.6.3.  Junio?\n\nCiao,\nDscho\n"},{"id":"111847","messageId":"20090421074540.GA7885@dingo.redhat.com","threadId":"18958","inReplyTo":"alpine.DEB.1.00.0904201152360.6955@intel-tinevez-2-302","subject":"Re: [PATCH/RESEND] git-submodule: add support for --rebase.","fromName":"Peter Hutterer","fromEmail":"peter.hutterer@who-t.net","sentAt":"2009-04-21T07:45:41Z","receivedAt":"2009-04-21T07:45:41Z","isPatch":true,"sender":{"key":"peter.hutterer@who-t.net","avatar":"https://avatars.githubusercontent.com/u/1487352?v=4"},"body":"On Mon, Apr 20, 2009 at 11:55:54AM +0200, Johannes Schindelin wrote:\n> On Mon, 20 Apr 2009, Peter Hutterer wrote:\n> \n> > 'git submodule update --rebase' rebases your local branch on top of what would\n> \n> This line is so long that it got wrapped in my mail program.  But it is \n> even worse: we would like to show this in an 80-column display with a \n> 4-space indent, so it would be nice if you could rewrap to 76 columns (I \n> even use 72 columns, because it looks nicer).\n\namended to 72 cols, see below.\n\n> > I'm still unsure about whether to change the wording (it currently uses \n> > the same terms as git-rebase and the rest of the git-submodule man \n> > page). Please let me know what to do to get this patch done.\n> \n> AFAIR I gave an alternative wording, am I wrong?\n\nyes, but tbh. I found it a bit confusing. Your suggestion was\n\n       \"Instead of detaching the HEAD to the revision committed in the\n        superproject, rebase the current branch onto that revision.\"\n\nHow about this one, basically the same but split up in two sentences:\n\n+--rebase::\n+\tThis option is only valid for the update command.\n+\tRebase the current branch onto the commit recorded in the\n+\tsuperproject. If this option is given, the submodule's HEAD will not\n+\tbe detached. If a a merge failure prevents this process, you will have\n+\tto resolve these failures with linkgit:git-rebase[1].\n+\n\nCheers,\n  Peter\n\n\n>From f5664840db1193311054eb38c91ec762846cd00c Mon Sep 17 00:00:00 2001\nFrom: Peter Hutterer <peter.hutterer@who-t.net>\nDate: Fri, 27 Mar 2009 13:42:42 +1000\nSubject: [PATCH] git-submodule: add support for --rebase.\n\n'git submodule update --rebase' rebases your local branch on top of what\nwould have been checked out to a detached HEAD otherwise.\n\nIn some cases, detaching the HEAD when updating a submodule complicates\nthe workflow to commit to this submodule (checkout master, rebase, then\ncommit).  For submodules that require frequent updates but infrequent\n(if any) commits, a rebase can be executed directly by the git-submodule\ncommand, ensuring that the submodules stay on their respective branches.\n\nSigned-off-by: Peter Hutterer <peter.hutterer@who-t.net>\n---\n Documentation/git-submodule.txt |   12 +++++-\n git-submodule.sh                |   22 +++++++++--\n t/t7404-submodule-update.sh     |   79 +++++++++++++++++++++++++++++++++++++++\n 3 files changed, 107 insertions(+), 6 deletions(-)\n create mode 100755 t/t7404-submodule-update.sh\n\ndiff --git a/Documentation/git-submodule.txt b/Documentation/git-submodule.txt\nindex 3b8df44..2935cb8 100644\n--- a/Documentation/git-submodule.txt\n+++ b/Documentation/git-submodule.txt\n@@ -12,7 +12,7 @@ SYNOPSIS\n 'git submodule' [--quiet] add [-b branch] [--] <repository> <path>\n 'git submodule' [--quiet] status [--cached] [--] [<path>...]\n 'git submodule' [--quiet] init [--] [<path>...]\n-'git submodule' [--quiet] update [--init] [-N|--no-fetch] [--] [<path>...]\n+'git submodule' [--quiet] update [--init] [-N|--no-fetch] [--rebase] [--] [<path>...]\n 'git submodule' [--quiet] summary [--summary-limit <n>] [commit] [--] [<path>...]\n 'git submodule' [--quiet] foreach <command>\n 'git submodule' [--quiet] sync [--] [<path>...]\n@@ -113,7 +113,8 @@ init::\n update::\n \tUpdate the registered submodules, i.e. clone missing submodules and\n \tcheckout the commit specified in the index of the containing repository.\n-\tThis will make the submodules HEAD be detached.\n+\tThis will make the submodules HEAD be detached unless '--rebase' is\n+\tspecified.\n +\n If the submodule is not yet initialized, and you just want to use the\n setting as stored in .gitmodules, you can automatically initialize the\n@@ -177,6 +178,13 @@ OPTIONS\n \tThis option is only valid for the update command.\n \tDon't fetch new objects from the remote site.\n \n+--rebase::\n+\tThis option is only valid for the update command.\n+\tRebase the current branch onto the commit recorded in the\n+\tsuperproject. If this option is given, the submodule's HEAD will not\n+\tbe detached. If a a merge failure prevents this process, you will have\n+\tto resolve these failures with linkgit:git-rebase[1].\n+\n <path>...::\n \tPaths to submodule(s). When specified this will restrict the command\n \tto only operate on the submodules found at the specified paths.\ndiff --git a/git-submodule.sh b/git-submodule.sh\nindex 7c2e060..e2d40ee 100755\n--- a/git-submodule.sh\n+++ b/git-submodule.sh\n@@ -17,6 +17,7 @@ branch=\n quiet=\n cached=\n nofetch=\n+rebase=\n \n #\n # print stuff on stdout unless -q was specified\n@@ -314,6 +315,10 @@ cmd_update()\n \t\t\tshift\n \t\t\tnofetch=1\n \t\t\t;;\n+\t\t-r|--rebase)\n+\t\t\tshift\n+\t\t\trebase=1\n+\t\t\t;;\n \t\t--)\n \t\t\tshift\n \t\t\tbreak\n@@ -367,11 +372,20 @@ cmd_update()\n \t\t\t\tdie \"Unable to fetch in submodule path '$path'\"\n \t\t\tfi\n \n-\t\t\t(unset GIT_DIR; cd \"$path\" &&\n-\t\t\t\t  git-checkout $force -q \"$sha1\") ||\n-\t\t\tdie \"Unable to checkout '$sha1' in submodule path '$path'\"\n+\t\t\tif test -z \"$rebase\"\n+\t\t\tthen\n+\t\t\t\tcommand=\"git-checkout $force -q\"\n+\t\t\t\taction=\"checkout\"\n+\t\t\t\tmsg=\"checked out\"\n+\t\t\telse\n+\t\t\t\tcommand=\"git-rebase\"\n+\t\t\t\taction=\"rebase\"\n+\t\t\t\tmsg=\"rebased onto\"\n+\t\t\tfi\n \n-\t\t\tsay \"Submodule path '$path': checked out '$sha1'\"\n+\t\t\t(unset GIT_DIR; cd \"$path\" && $command \"$sha1\") ||\n+\t\t\tdie \"Unable to $action '$sha1' in submodule path '$path'\"\n+\t\t\tsay \"Submodule path '$path': $msg '$sha1'\"\n \t\tfi\n \tdone\n }\ndiff --git a/t/t7404-submodule-update.sh b/t/t7404-submodule-update.sh\nnew file mode 100755\nindex 0000000..20cc093\n--- /dev/null\n+++ b/t/t7404-submodule-update.sh\n@@ -0,0 +1,79 @@\n+#!/bin/sh\n+#\n+# Copyright (c) 2009 Red Hat, Inc.\n+#\n+\n+test_description='Test updating submodules\n+\n+This test verifies that \"git submodule update\" detaches the HEAD of the\n+submodule and \"git submodule update --rebase\" does not detach the HEAD.\n+'\n+\n+. ./test-lib.sh\n+\n+\n+compare_head()\n+{\n+    sha_master=`git-rev-list --max-count=1 master`\n+    sha_head=`git-rev-list --max-count=1 HEAD`\n+\n+    test \"$sha_master\" = \"$sha_head\"\n+}\n+\n+\n+test_expect_success 'setup a submodule tree' '\n+\techo file > file &&\n+\tgit add file &&\n+\ttest_tick &&\n+\tgit commit -m upstream\n+\tgit clone . super &&\n+\tgit clone super submodule &&\n+\t(cd super &&\n+\t git submodule add ../submodule submodule &&\n+\t test_tick &&\n+\t git commit -m \"submodule\" &&\n+\t git submodule init submodule\n+\t) &&\n+\t(cd submodule &&\n+\techo \"line2\" > file &&\n+\tgit add file &&\n+\tgit commit -m \"Commit 2\"\n+\t) &&\n+\t(cd super &&\n+\t (cd submodule &&\n+\t  git pull --rebase origin\n+\t ) &&\n+\t git add submodule &&\n+\t git commit -m \"submodule update\"\n+\t)\n+'\n+\n+test_expect_success 'submodule update detaching the HEAD ' '\n+\t(cd super/submodule &&\n+\t git reset --hard HEAD~1\n+\t) &&\n+\t(cd super &&\n+\t (cd submodule &&\n+\t  compare_head\n+\t ) &&\n+\t git submodule update submodule &&\n+\t cd submodule &&\n+\t ! compare_head\n+\t)\n+'\n+\n+test_expect_success 'submodule update --rebase staying on master' '\n+\t(cd super/submodule &&\n+\t  git checkout master\n+\t) &&\n+\t(cd super &&\n+\t (cd submodule &&\n+\t  compare_head\n+\t ) &&\n+\t git submodule update --rebase submodule &&\n+\t cd submodule &&\n+\t compare_head\n+\t)\n+'\n+\n+test_done\n-- \n1.6.2.2.447.g4afa7\n"},{"id":"111852","messageId":"alpine.DEB.1.00.0904211047311.10279@pacific.mpi-cbg.de","threadId":"18958","inReplyTo":"20090421074540.GA7885@dingo.redhat.com","subject":"Re: [PATCH/RESEND] git-submodule: add support for --rebase.","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2009-04-21T08:47:53Z","receivedAt":"2009-04-21T08:47:53Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Tue, 21 Apr 2009, Peter Hutterer wrote:\n\n> On Mon, Apr 20, 2009 at 11:55:54AM +0200, Johannes Schindelin wrote:\n> > On Mon, 20 Apr 2009, Peter Hutterer wrote:\n> > \n> > > 'git submodule update --rebase' rebases your local branch on top of what would\n> > \n> > This line is so long that it got wrapped in my mail program.  But it is \n> > even worse: we would like to show this in an 80-column display with a \n> > 4-space indent, so it would be nice if you could rewrap to 76 columns (I \n> > even use 72 columns, because it looks nicer).\n> \n> amended to 72 cols, see below.\n\nThanks.\n\n> > > I'm still unsure about whether to change the wording (it currently uses \n> > > the same terms as git-rebase and the rest of the git-submodule man \n> > > page). Please let me know what to do to get this patch done.\n> > \n> > AFAIR I gave an alternative wording, am I wrong?\n> \n> yes, but tbh. I found it a bit confusing. Your suggestion was\n> \n>        \"Instead of detaching the HEAD to the revision committed in the\n>         superproject, rebase the current branch onto that revision.\"\n> \n> How about this one, basically the same but split up in two sentences:\n> \n> +--rebase::\n> +\tThis option is only valid for the update command.\n> +\tRebase the current branch onto the commit recorded in the\n> +\tsuperproject. If this option is given, the submodule's HEAD will not\n> +\tbe detached. If a a merge failure prevents this process, you will have\n> +\tto resolve these failures with linkgit:git-rebase[1].\n\nWay better!\n\nThank you,\nDscho\n"},{"id":"112039","messageId":"20090423034709.GA22244@dingo.bne.redhat.com","threadId":"18958","inReplyTo":"alpine.DEB.1.00.0904211047311.10279@pacific.mpi-cbg.de","subject":"Re: [PATCH/RESEND] git-submodule: add support for --rebase.","fromName":"Peter Hutterer","fromEmail":"peter.hutterer@who-t.net","sentAt":"2009-04-23T03:47:11Z","receivedAt":"2009-04-23T03:47:11Z","isPatch":true,"sender":{"key":"peter.hutterer@who-t.net","avatar":"https://avatars.githubusercontent.com/u/1487352?v=4"},"body":"'git submodule update --rebase' rebases your local branch on top of what\nwould have been checked out to a detached HEAD otherwise.\n\nIn some cases, detaching the HEAD when updating a submodule complicates\nthe workflow to commit to this submodule (checkout master, rebase, then\ncommit).  For submodules that require frequent updates but infrequent\n(if any) commits, a rebase can be executed directly by the git-submodule\ncommand, ensuring that the submodules stay on their respective branches.\n\ngit-config key: submodule.$name.rebase (bool)\n\nSigned-off-by: Peter Hutterer <peter.hutterer@who-t.net>\n---\n\nI figured if we're waiting for 1.6.3 anyway I might as well add support\nfor gitconfig to make this feature \"complete\".\nTest cases are updated as well.\n\nCheers,\n  Peter\n\n\n Documentation/git-submodule.txt |   14 ++++-\n git-submodule.sh                |   28 +++++++-\n t/t7404-submodule-update.sh     |  130 +++++++++++++++++++++++++++++++++++++++\n 3 files changed, 166 insertions(+), 6 deletions(-)\n create mode 100755 t/t7404-submodule-update.sh\n\ndiff --git a/Documentation/git-submodule.txt b/Documentation/git-submodule.txt\nindex 3b8df44..0286409 100644\n--- a/Documentation/git-submodule.txt\n+++ b/Documentation/git-submodule.txt\n@@ -12,7 +12,7 @@ SYNOPSIS\n 'git submodule' [--quiet] add [-b branch] [--] <repository> <path>\n 'git submodule' [--quiet] status [--cached] [--] [<path>...]\n 'git submodule' [--quiet] init [--] [<path>...]\n-'git submodule' [--quiet] update [--init] [-N|--no-fetch] [--] [<path>...]\n+'git submodule' [--quiet] update [--init] [-N|--no-fetch] [--rebase] [--] [<path>...]\n 'git submodule' [--quiet] summary [--summary-limit <n>] [commit] [--] [<path>...]\n 'git submodule' [--quiet] foreach <command>\n 'git submodule' [--quiet] sync [--] [<path>...]\n@@ -113,7 +113,8 @@ init::\n update::\n \tUpdate the registered submodules, i.e. clone missing submodules and\n \tcheckout the commit specified in the index of the containing repository.\n-\tThis will make the submodules HEAD be detached.\n+\tThis will make the submodules HEAD be detached unless '--rebase' is\n+\tspecified or the key `submodule.$name.rebase` is set to `true`.\n +\n If the submodule is not yet initialized, and you just want to use the\n setting as stored in .gitmodules, you can automatically initialize the\n@@ -177,6 +178,15 @@ OPTIONS\n \tThis option is only valid for the update command.\n \tDon't fetch new objects from the remote site.\n \n+--rebase::\n+\tThis option is only valid for the update command.\n+\tRebase the current branch onto the commit recorded in the\n+\tsuperproject. If this option is given, the submodule's HEAD will not\n+\tbe detached. If a a merge failure prevents this process, you will have\n+\tto resolve these failures with linkgit:git-rebase[1].\n+\tIf the key `submodule.$name.rebase` is set to `true`, this option is\n+\timplicit.\n+\n <path>...::\n \tPaths to submodule(s). When specified this will restrict the command\n \tto only operate on the submodules found at the specified paths.\ndiff --git a/git-submodule.sh b/git-submodule.sh\nindex 7c2e060..c4ba19a 100755\n--- a/git-submodule.sh\n+++ b/git-submodule.sh\n@@ -17,6 +17,7 @@ branch=\n quiet=\n cached=\n nofetch=\n+rebase=\n \n #\n # print stuff on stdout unless -q was specified\n@@ -314,6 +315,10 @@ cmd_update()\n \t\t\tshift\n \t\t\tnofetch=1\n \t\t\t;;\n+\t\t-r|--rebase)\n+\t\t\tshift\n+\t\t\trebase=true\n+\t\t\t;;\n \t\t--)\n \t\t\tshift\n \t\t\tbreak\n@@ -332,6 +337,7 @@ cmd_update()\n \tdo\n \t\tname=$(module_name \"$path\") || exit\n \t\turl=$(git config submodule.\"$name\".url)\n+\t\trebase_module=$(git config submodule.\"$name\".rebase)\n \t\tif test -z \"$url\"\n \t\tthen\n \t\t\t# Only mention uninitialized submodules when its\n@@ -352,6 +358,11 @@ cmd_update()\n \t\t\tdie \"Unable to find current revision in submodule path '$path'\"\n \t\tfi\n \n+\t\tif test true = \"$rebase\"\n+\t\tthen\n+\t\t\trebase_module=true\n+\t\tfi\n+\n \t\tif test \"$subsha1\" != \"$sha1\"\n \t\tthen\n \t\t\tforce=\n@@ -367,11 +378,20 @@ cmd_update()\n \t\t\t\tdie \"Unable to fetch in submodule path '$path'\"\n \t\t\tfi\n \n-\t\t\t(unset GIT_DIR; cd \"$path\" &&\n-\t\t\t\t  git-checkout $force -q \"$sha1\") ||\n-\t\t\tdie \"Unable to checkout '$sha1' in submodule path '$path'\"\n+\t\t\tif test true = \"$rebase_module\"\n+\t\t\tthen\n+\t\t\t\tcommand=\"git-rebase\"\n+\t\t\t\taction=\"rebase\"\n+\t\t\t\tmsg=\"rebased onto\"\n+\t\t\telse\n+\t\t\t\tcommand=\"git-checkout $force -q\"\n+\t\t\t\taction=\"checkout\"\n+\t\t\t\tmsg=\"checked out\"\n+\t\t\tfi\n \n-\t\t\tsay \"Submodule path '$path': checked out '$sha1'\"\n+\t\t\t(unset GIT_DIR; cd \"$path\" && $command \"$sha1\") ||\n+\t\t\tdie \"Unable to $action '$sha1' in submodule path '$path'\"\n+\t\t\tsay \"Submodule path '$path': $msg '$sha1'\"\n \t\tfi\n \tdone\n }\ndiff --git a/t/t7404-submodule-update.sh b/t/t7404-submodule-update.sh\nnew file mode 100755\nindex 0000000..d70bae1\n--- /dev/null\n+++ b/t/t7404-submodule-update.sh\n@@ -0,0 +1,130 @@\n+#!/bin/sh\n+#\n+# Copyright (c) 2009 Red Hat, Inc.\n+#\n+\n+test_description='Test updating submodules\n+\n+This test verifies that \"git submodule update\" detaches the HEAD of the\n+submodule and \"git submodule update --rebase\" does not detach the HEAD.\n+'\n+\n+. ./test-lib.sh\n+\n+\n+compare_head()\n+{\n+    sha_master=`git-rev-list --max-count=1 master`\n+    sha_head=`git-rev-list --max-count=1 HEAD`\n+\n+    test \"$sha_master\" = \"$sha_head\"\n+}\n+\n+\n+test_expect_success 'setup a submodule tree' '\n+\techo file > file &&\n+\tgit add file &&\n+\ttest_tick &&\n+\tgit commit -m upstream\n+\tgit clone . super &&\n+\tgit clone super submodule &&\n+\t(cd super &&\n+\t git submodule add ../submodule submodule &&\n+\t test_tick &&\n+\t git commit -m \"submodule\" &&\n+\t git submodule init submodule\n+\t) &&\n+\t(cd submodule &&\n+\techo \"line2\" > file &&\n+\tgit add file &&\n+\tgit commit -m \"Commit 2\"\n+\t) &&\n+\t(cd super &&\n+\t (cd submodule &&\n+\t  git pull --rebase origin\n+\t ) &&\n+\t git add submodule &&\n+\t git commit -m \"submodule update\"\n+\t)\n+'\n+\n+test_expect_success 'submodule update detaching the HEAD ' '\n+\t(cd super/submodule &&\n+\t git reset --hard HEAD~1\n+\t) &&\n+\t(cd super &&\n+\t (cd submodule &&\n+\t  compare_head\n+\t ) &&\n+\t git submodule update submodule &&\n+\t cd submodule &&\n+\t ! compare_head\n+\t)\n+'\n+\n+test_expect_success 'submodule update --rebase staying on master' '\n+\t(cd super/submodule &&\n+\t  git checkout master\n+\t) &&\n+\t(cd super &&\n+\t (cd submodule &&\n+\t  compare_head\n+\t ) &&\n+\t git submodule update --rebase submodule &&\n+\t cd submodule &&\n+\t compare_head\n+\t)\n+'\n+\n+test_expect_success 'submodule update - rebase true in .git/config' '\n+\t(cd super &&\n+\t git config submodule.submodule.rebase true\n+\t) &&\n+\t(cd super/submodule &&\n+\t  git reset --hard HEAD~1\n+\t) &&\n+\t(cd super &&\n+\t (cd submodule &&\n+\t  compare_head\n+\t ) &&\n+\t git submodule update submodule &&\n+\t cd submodule &&\n+\t compare_head\n+\t)\n+'\n+\n+test_expect_success 'submodule update - rebase false in .git/config but --rebase given' '\n+\t(cd super &&\n+\t git config submodule.submodule.rebase false\n+\t) &&\n+\t(cd super/submodule &&\n+\t  git reset --hard HEAD~1\n+\t) &&\n+\t(cd super &&\n+\t (cd submodule &&\n+\t  compare_head\n+\t ) &&\n+\t git submodule update --rebase submodule &&\n+\t cd submodule &&\n+\t compare_head\n+\t)\n+'\n+\n+test_expect_success 'submodule update - rebase false in .git/config' '\n+\t(cd super &&\n+\t git config submodule.submodule.rebase false\n+\t) &&\n+\t(cd super/submodule &&\n+\t  git reset --hard HEAD^\n+\t) &&\n+\t(cd super &&\n+\t (cd submodule &&\n+\t  compare_head\n+\t ) &&\n+\t git submodule update submodule &&\n+\t cd submodule &&\n+\t ! compare_head\n+\t)\n+'\n+\n+test_done\n-- \n1.6.3.rc1.2.gfa66a\n"},{"id":"112061","messageId":"alpine.DEB.1.00.0904231119160.10279@pacific.mpi-cbg.de","threadId":"18958","inReplyTo":"20090423034709.GA22244@dingo.bne.redhat.com","subject":"Re: [PATCH/RESEND] git-submodule: add support for --rebase.","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2009-04-23T09:20:08Z","receivedAt":"2009-04-23T09:20:08Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Thu, 23 Apr 2009, Peter Hutterer wrote:\n\n> 'git submodule update --rebase' rebases your local branch on top of what\n> would have been checked out to a detached HEAD otherwise.\n> \n> In some cases, detaching the HEAD when updating a submodule complicates\n> the workflow to commit to this submodule (checkout master, rebase, then\n> commit).  For submodules that require frequent updates but infrequent\n> (if any) commits, a rebase can be executed directly by the git-submodule\n> command, ensuring that the submodules stay on their respective branches.\n> \n> git-config key: submodule.$name.rebase (bool)\n> \n> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>\n> ---\n> \n> I figured if we're waiting for 1.6.3 anyway I might as well add support\n> for gitconfig to make this feature \"complete\".\n> Test cases are updated as well.\n\nThanks.\n\nWith this squashed in, I actually would not be too opposed to put this \ninto 1.6.3, as it _is_ an improvement.\n\n-- snipsnap --\n[PATCH] To be squashed in\n\nThis does three things:\n\n- add .gitmodules support for rebase,\n- use --bool for the git config calls for type checking, and\n- rename ambiguous t7404 to t7406.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n Documentation/gitmodules.txt                       |    3 +++\n git-submodule.sh                                   |    7 ++++++-\n ...bmodule-update.sh => t7406-submodule-update.sh} |   10 ++++++++++\n 3 files changed, 19 insertions(+), 1 deletions(-)\n rename t/{t7404-submodule-update.sh => t7406-submodule-update.sh} (88%)\n\ndiff --git a/Documentation/gitmodules.txt b/Documentation/gitmodules.txt\nindex d1a17e2..7c22c40 100644\n--- a/Documentation/gitmodules.txt\n+++ b/Documentation/gitmodules.txt\n@@ -30,6 +30,9 @@ submodule.<name>.path::\n submodule.<name>.url::\n \tDefines an url from where the submodule repository can be cloned.\n \n+submodule.<name>.rebase::\n+\tDefines that the submodule should be rebased by default.\n+\n \n EXAMPLES\n --------\ndiff --git a/git-submodule.sh b/git-submodule.sh\nindex 091cb2d..3176226 100755\n--- a/git-submodule.sh\n+++ b/git-submodule.sh\n@@ -295,6 +295,11 @@ cmd_init()\n \t\tgit config submodule.\"$name\".url \"$url\" ||\n \t\tdie \"Failed to register url for submodule path '$path'\"\n \n+\t\ttest true != \"$(git config -f .gitmodules --bool \\\n+\t\t\tsubmodule.\"$name\".rebase)\" ||\n+\t\tgit config submodule.\"$name\".rebase true ||\n+\t\tdie \"Failed to register submodule path '$path' as rebasing\"\n+\n \t\tsay \"Submodule '$name' ($url) registered for path '$path'\"\n \tdone\n }\n@@ -344,7 +349,7 @@ cmd_update()\n \tdo\n \t\tname=$(module_name \"$path\") || exit\n \t\turl=$(git config submodule.\"$name\".url)\n-\t\trebase_module=$(git config submodule.\"$name\".rebase)\n+\t\trebase_module=$(git config --bool submodule.\"$name\".rebase)\n \t\tif test -z \"$url\"\n \t\tthen\n \t\t\t# Only mention uninitialized submodules when its\ndiff --git a/t/t7404-submodule-update.sh b/t/t7406-submodule-update.sh\nsimilarity index 88%\nrename from t/t7404-submodule-update.sh\nrename to t/t7406-submodule-update.sh\nindex d70bae1..3a474be 100755\n--- a/t/t7404-submodule-update.sh\n+++ b/t/t7406-submodule-update.sh\n@@ -127,4 +127,14 @@ test_expect_success 'submodule update - rebase false in .git/config' '\n \t)\n '\n \n+test_expect_success 'submodule init picks up rebase' '\n+\t(cd super &&\n+\t git config submodule.rebasing.url git://non-existing/git &&\n+\t git config submodule.rebasing.path does-not-mater &&\n+\t git config submodule.rebasing.rebase true &&\n+\t git submodule init rebasing &&\n+\t test true = $(git config --bool submodule.rebasing.rebase)\n+\t)\n+'\n+\n test_done\n-- \n1.6.2.1.613.g25746\n"},{"id":"112142","messageId":"20090423230637.GE2282@dingo.bne.redhat.com","threadId":"18958","inReplyTo":"alpine.DEB.1.00.0904231119160.10279@pacific.mpi-cbg.de","subject":"Re: [PATCH/RESEND] git-submodule: add support for --rebase.","fromName":"Peter Hutterer","fromEmail":"peter.hutterer@who-t.net","sentAt":"2009-04-23T23:06:38Z","receivedAt":"2009-04-23T23:06:38Z","isPatch":true,"sender":{"key":"peter.hutterer@who-t.net","avatar":"https://avatars.githubusercontent.com/u/1487352?v=4"},"body":"'git submodule update --rebase' rebases your local branch on top of what\nwould have been checked out to a detached HEAD otherwise.\n\nIn some cases, detaching the HEAD when updating a submodule complicates\nthe workflow to commit to this submodule (checkout master, rebase, then\ncommit).  For submodules that require frequent updates but infrequent\n(if any) commits, a rebase can be executed directly by the git-submodule\ncommand, ensuring that the submodules stay on their respective branches.\n\ngit-config key: submodule.$name.rebase (bool)\n\nSigned-off-by: Peter Hutterer <peter.hutterer@who-t.net>\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n\n> With this squashed in, I actually would not be too opposed to put this \n> into 1.6.3, as it _is_ an improvement.\n> \n> -- snipsnap --\n> [PATCH] To be squashed in\n> \n> This does three things:\n> \n> - add .gitmodules support for rebase,\n> - use --bool for the git config calls for type checking, and\n> - rename ambiguous t7404 to t7406.\n> \n> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n\nSquashed in, thank you. One typo fixed in last testcase (does-not-mater ->\ndoes-not-matter).\n\n Documentation/git-submodule.txt |   14 ++++-\n Documentation/gitmodules.txt    |    3 +\n git-submodule.sh                |   33 ++++++++-\n t/t7406-submodule-update.sh     |  140 +++++++++++++++++++++++++++++++++++++++\n 4 files changed, 184 insertions(+), 6 deletions(-)\n create mode 100755 t/t7406-submodule-update.sh\n\ndiff --git a/Documentation/git-submodule.txt b/Documentation/git-submodule.txt\nindex 3b8df44..0286409 100644\n--- a/Documentation/git-submodule.txt\n+++ b/Documentation/git-submodule.txt\n@@ -12,7 +12,7 @@ SYNOPSIS\n 'git submodule' [--quiet] add [-b branch] [--] <repository> <path>\n 'git submodule' [--quiet] status [--cached] [--] [<path>...]\n 'git submodule' [--quiet] init [--] [<path>...]\n-'git submodule' [--quiet] update [--init] [-N|--no-fetch] [--] [<path>...]\n+'git submodule' [--quiet] update [--init] [-N|--no-fetch] [--rebase] [--] [<path>...]\n 'git submodule' [--quiet] summary [--summary-limit <n>] [commit] [--] [<path>...]\n 'git submodule' [--quiet] foreach <command>\n 'git submodule' [--quiet] sync [--] [<path>...]\n@@ -113,7 +113,8 @@ init::\n update::\n \tUpdate the registered submodules, i.e. clone missing submodules and\n \tcheckout the commit specified in the index of the containing repository.\n-\tThis will make the submodules HEAD be detached.\n+\tThis will make the submodules HEAD be detached unless '--rebase' is\n+\tspecified or the key `submodule.$name.rebase` is set to `true`.\n +\n If the submodule is not yet initialized, and you just want to use the\n setting as stored in .gitmodules, you can automatically initialize the\n@@ -177,6 +178,15 @@ OPTIONS\n \tThis option is only valid for the update command.\n \tDon't fetch new objects from the remote site.\n \n+--rebase::\n+\tThis option is only valid for the update command.\n+\tRebase the current branch onto the commit recorded in the\n+\tsuperproject. If this option is given, the submodule's HEAD will not\n+\tbe detached. If a a merge failure prevents this process, you will have\n+\tto resolve these failures with linkgit:git-rebase[1].\n+\tIf the key `submodule.$name.rebase` is set to `true`, this option is\n+\timplicit.\n+\n <path>...::\n \tPaths to submodule(s). When specified this will restrict the command\n \tto only operate on the submodules found at the specified paths.\ndiff --git a/Documentation/gitmodules.txt b/Documentation/gitmodules.txt\nindex d1a17e2..7c22c40 100644\n--- a/Documentation/gitmodules.txt\n+++ b/Documentation/gitmodules.txt\n@@ -30,6 +30,9 @@ submodule.<name>.path::\n submodule.<name>.url::\n \tDefines an url from where the submodule repository can be cloned.\n \n+submodule.<name>.rebase::\n+\tDefines that the submodule should be rebased by default.\n+\n \n EXAMPLES\n --------\ndiff --git a/git-submodule.sh b/git-submodule.sh\nindex 7c2e060..b7c9bdc 100755\n--- a/git-submodule.sh\n+++ b/git-submodule.sh\n@@ -17,6 +17,7 @@ branch=\n quiet=\n cached=\n nofetch=\n+rebase=\n \n #\n # print stuff on stdout unless -q was specified\n@@ -287,6 +288,11 @@ cmd_init()\n \t\tgit config submodule.\"$name\".url \"$url\" ||\n \t\tdie \"Failed to register url for submodule path '$path'\"\n \n+\t\ttest true != \"$(git config -f .gitmodules --bool \\\n+\t\t\tsubmodule.\"$name\".rebase)\" ||\n+\t\tgit config submodule.\"$name\".rebase true ||\n+\t\tdie \"Failed to register submodule path '$path' as rebasing\"\n+\n \t\tsay \"Submodule '$name' ($url) registered for path '$path'\"\n \tdone\n }\n@@ -314,6 +320,10 @@ cmd_update()\n \t\t\tshift\n \t\t\tnofetch=1\n \t\t\t;;\n+\t\t-r|--rebase)\n+\t\t\tshift\n+\t\t\trebase=true\n+\t\t\t;;\n \t\t--)\n \t\t\tshift\n \t\t\tbreak\n@@ -332,6 +342,7 @@ cmd_update()\n \tdo\n \t\tname=$(module_name \"$path\") || exit\n \t\turl=$(git config submodule.\"$name\".url)\n+\t\trebase_module=$(git config --bool submodule.\"$name\".rebase)\n \t\tif test -z \"$url\"\n \t\tthen\n \t\t\t# Only mention uninitialized submodules when its\n@@ -352,6 +363,11 @@ cmd_update()\n \t\t\tdie \"Unable to find current revision in submodule path '$path'\"\n \t\tfi\n \n+\t\tif test true = \"$rebase\"\n+\t\tthen\n+\t\t\trebase_module=true\n+\t\tfi\n+\n \t\tif test \"$subsha1\" != \"$sha1\"\n \t\tthen\n \t\t\tforce=\n@@ -367,11 +383,20 @@ cmd_update()\n \t\t\t\tdie \"Unable to fetch in submodule path '$path'\"\n \t\t\tfi\n \n-\t\t\t(unset GIT_DIR; cd \"$path\" &&\n-\t\t\t\t  git-checkout $force -q \"$sha1\") ||\n-\t\t\tdie \"Unable to checkout '$sha1' in submodule path '$path'\"\n+\t\t\tif test true = \"$rebase_module\"\n+\t\t\tthen\n+\t\t\t\tcommand=\"git-rebase\"\n+\t\t\t\taction=\"rebase\"\n+\t\t\t\tmsg=\"rebased onto\"\n+\t\t\telse\n+\t\t\t\tcommand=\"git-checkout $force -q\"\n+\t\t\t\taction=\"checkout\"\n+\t\t\t\tmsg=\"checked out\"\n+\t\t\tfi\n \n-\t\t\tsay \"Submodule path '$path': checked out '$sha1'\"\n+\t\t\t(unset GIT_DIR; cd \"$path\" && $command \"$sha1\") ||\n+\t\t\tdie \"Unable to $action '$sha1' in submodule path '$path'\"\n+\t\t\tsay \"Submodule path '$path': $msg '$sha1'\"\n \t\tfi\n \tdone\n }\ndiff --git a/t/t7406-submodule-update.sh b/t/t7406-submodule-update.sh\nnew file mode 100755\nindex 0000000..3442c05\n--- /dev/null\n+++ b/t/t7406-submodule-update.sh\n@@ -0,0 +1,140 @@\n+#!/bin/sh\n+#\n+# Copyright (c) 2009 Red Hat, Inc.\n+#\n+\n+test_description='Test updating submodules\n+\n+This test verifies that \"git submodule update\" detaches the HEAD of the\n+submodule and \"git submodule update --rebase\" does not detach the HEAD.\n+'\n+\n+. ./test-lib.sh\n+\n+\n+compare_head()\n+{\n+    sha_master=`git-rev-list --max-count=1 master`\n+    sha_head=`git-rev-list --max-count=1 HEAD`\n+\n+    test \"$sha_master\" = \"$sha_head\"\n+}\n+\n+\n+test_expect_success 'setup a submodule tree' '\n+\techo file > file &&\n+\tgit add file &&\n+\ttest_tick &&\n+\tgit commit -m upstream\n+\tgit clone . super &&\n+\tgit clone super submodule &&\n+\t(cd super &&\n+\t git submodule add ../submodule submodule &&\n+\t test_tick &&\n+\t git commit -m \"submodule\" &&\n+\t git submodule init submodule\n+\t) &&\n+\t(cd submodule &&\n+\techo \"line2\" > file &&\n+\tgit add file &&\n+\tgit commit -m \"Commit 2\"\n+\t) &&\n+\t(cd super &&\n+\t (cd submodule &&\n+\t  git pull --rebase origin\n+\t ) &&\n+\t git add submodule &&\n+\t git commit -m \"submodule update\"\n+\t)\n+'\n+\n+test_expect_success 'submodule update detaching the HEAD ' '\n+\t(cd super/submodule &&\n+\t git reset --hard HEAD~1\n+\t) &&\n+\t(cd super &&\n+\t (cd submodule &&\n+\t  compare_head\n+\t ) &&\n+\t git submodule update submodule &&\n+\t cd submodule &&\n+\t ! compare_head\n+\t)\n+'\n+\n+test_expect_success 'submodule update --rebase staying on master' '\n+\t(cd super/submodule &&\n+\t  git checkout master\n+\t) &&\n+\t(cd super &&\n+\t (cd submodule &&\n+\t  compare_head\n+\t ) &&\n+\t git submodule update --rebase submodule &&\n+\t cd submodule &&\n+\t compare_head\n+\t)\n+'\n+\n+test_expect_success 'submodule update - rebase true in .git/config' '\n+\t(cd super &&\n+\t git config submodule.submodule.rebase true\n+\t) &&\n+\t(cd super/submodule &&\n+\t  git reset --hard HEAD~1\n+\t) &&\n+\t(cd super &&\n+\t (cd submodule &&\n+\t  compare_head\n+\t ) &&\n+\t git submodule update submodule &&\n+\t cd submodule &&\n+\t compare_head\n+\t)\n+'\n+\n+test_expect_success 'submodule update - rebase false in .git/config but --rebase given' '\n+\t(cd super &&\n+\t git config submodule.submodule.rebase false\n+\t) &&\n+\t(cd super/submodule &&\n+\t  git reset --hard HEAD~1\n+\t) &&\n+\t(cd super &&\n+\t (cd submodule &&\n+\t  compare_head\n+\t ) &&\n+\t git submodule update --rebase submodule &&\n+\t cd submodule &&\n+\t compare_head\n+\t)\n+'\n+\n+test_expect_success 'submodule update - rebase false in .git/config' '\n+\t(cd super &&\n+\t git config submodule.submodule.rebase false\n+\t) &&\n+\t(cd super/submodule &&\n+\t  git reset --hard HEAD^\n+\t) &&\n+\t(cd super &&\n+\t (cd submodule &&\n+\t  compare_head\n+\t ) &&\n+\t git submodule update submodule &&\n+\t cd submodule &&\n+\t ! compare_head\n+\t)\n+'\n+\n+test_expect_success 'submodule init picks up rebase' '\n+\t(cd super &&\n+\t git config submodule.rebasing.url git://non-existing/git &&\n+\t git config submodule.rebasing.path does-not-matter &&\n+\t git config submodule.rebasing.rebase true &&\n+\t git submodule init rebasing &&\n+\t test true = $(git config --bool submodule.rebasing.rebase)\n+\t)\n+'\n+\n+test_done\n-- \n1.6.3.rc1.2.gfa66a\n"},{"id":"112163","messageId":"alpine.DEB.1.00.0904240839400.7393@intel-tinevez-2-302","threadId":"18958","inReplyTo":"20090423230637.GE2282@dingo.bne.redhat.com","subject":"Re: [PATCH/RESEND] git-submodule: add support for --rebase.","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2009-04-24T06:41:14Z","receivedAt":"2009-04-24T06:41:14Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Fri, 24 Apr 2009, Peter Hutterer wrote:\n\n> 'git submodule update --rebase' rebases your local branch on top of what\n> would have been checked out to a detached HEAD otherwise.\n> \n> In some cases, detaching the HEAD when updating a submodule complicates\n> the workflow to commit to this submodule (checkout master, rebase, then\n> commit).  For submodules that require frequent updates but infrequent\n> (if any) commits, a rebase can be executed directly by the git-submodule\n> command, ensuring that the submodules stay on their respective branches.\n> \n> git-config key: submodule.$name.rebase (bool)\n> \n> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>\n> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n\nYes, I hereby give my sign-off ;-)\n\n> ---\n> \n> > With this squashed in, I actually would not be too opposed to put this \n> > into 1.6.3, as it _is_ an improvement.\n> > \n> > -- snipsnap --\n> > [PATCH] To be squashed in\n> > \n> > This does three things:\n> > \n> > - add .gitmodules support for rebase,\n> > - use --bool for the git config calls for type checking, and\n> > - rename ambiguous t7404 to t7406.\n> > \n> > Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n> \n> Squashed in, thank you. One typo fixed in last testcase (does-not-mater ->\n> does-not-matter).\n\nI just blame it on the lousy Acer keyboard which cannot follow the speed \nof my fingers.\n\nThanks!\n\nJunio, how about it? post 1.6.3 or not?  It is a well contained change, \nwith little chance of breaking something, but offers a more sensible \nworkflow here.\n\nCiao,\nDscho\n"},{"id":"112210","messageId":"7vskjydnxy.fsf@gitster.siamese.dyndns.org","threadId":"18958","inReplyTo":"alpine.DEB.1.00.0904240839400.7393@intel-tinevez-2-302","subject":"Re: [PATCH/RESEND] git-submodule: add support for --rebase.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-04-24T16:19:21Z","receivedAt":"2009-04-24T16:19:21Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n> Yes, I hereby give my sign-off ;-)\n>\n>> ---\n>> \n>> > With this squashed in, I actually would not be too opposed to put this \n>> > into 1.6.3, as it _is_ an improvement.\n\nI am afraid it is a bit too late for \"improvements\" after -rc1.  People\nsurvived without the new feature until now, and they can wait a bit longer\nfor the next one.  I would welcome \"fixes\" til -rc2 but after that I'd\nlike people to focus only on regressions and fixes to new features.\nAgain, people lived with known breakages that weren't fixed before -rc2,\nand fixes to them can wait.\n"}]}