{"thread":{"id":"19623","subject":"What's cooking in git.git (May 2009, #04; Sun, 31)","startedAt":"2009-06-01T01:24:58Z","lastAt":"2009-06-03T06:46:35Z","messageCount":11,"participants":["Junio C Hamano","Brandon Casey","Johan Herland","Peter Hutterer","Markus Heidelberg"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"115171","messageId":"7v63fgpwyd.fsf@alter.siamese.dyndns.org","threadId":"19623","inReplyTo":null,"subject":"What's cooking in git.git (May 2009, #04; Sun, 31)","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-06-01T01:24:58Z","receivedAt":"2009-06-01T01:24:58Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Here are the topics that have been cooking.  Commits prefixed with '-' are\nonly in 'pu' while commits prefixed with '+' are in 'next'.  The ones\nmarked with '.' do not appear in any of the branches, but I am still\nholding onto them.\n\nThe topics list the commits in reverse chronological order.  The topics\nmeant to be merged to the maintenance series have \"maint-\" in their names.\n\n----------------------------------------------------------------\n[New Topics]\n\nAll of these are soon to be in 'next'.\n\n* bc/solaris (Wed May 27 21:17:08 2009 -0500) 4 commits\n - Makefile: introduce SANE_TOOL_PATH for prepending required\n   elements to PATH\n - Makefile: add section for SunOS 5.7\n - Makefile: add NEEDS_RESOLV to optionally add -lresolv to compile\n   arguments\n - Makefile: use /usr/ucb/install on SunOS platforms rather than\n   ginstall\n\n* nw/maint-cvsexportcommit (Fri May 29 00:23:33 2009 +0100) 1 commit\n - git-cvsexportcommit can't commit files which have been removed\n   from CVS\n\n* tr/maint-doc-stash-pop (Thu May 28 11:40:15 2009 +0200) 1 commit\n - Documentation: teach stash/pop workflow instead of stash/apply\n\n* da/pretty-tempname (Sun May 31 01:35:52 2009 -0700) 3 commits\n - diff: generate pretty filenames in prep_temp_blob()\n - compat: add a basename() compatibility function\n - compat: add a mkstemps() compatibility function\n\n* ak/maint-for-each-ref-no-lookup (Wed May 27 15:23:12 2009 -0400) 1 commit\n - for-each-ref: Do not lookup objects when they will not be used\n\n* cb/match_refs_internal_tail (Wed May 27 22:13:44 2009 +0200) 1 commit\n - match_refs: search ref list tail internally\n\nI need to replace this with the new iteration...\n\n* gb/am-foreign (Wed May 27 11:25:19 2009 +0200) 4 commits\n - git-am: refactor 'cleaning up and aborting'\n - git-am foreign patch support: StGIT support\n - git-am foreign patch support: autodetect some patch formats\n - git-am foreign patch support: introduce patch_format\n\n----------------------------------------------------------------\n[Graduated to \"master\"]\n\n* sb/opt-filename (Sat May 23 11:53:13 2009 -0700) 2 commits\n + parse-opts: add OPT_FILENAME and transition builtins\n + parse-opts: prepare for OPT_FILENAME\n\n* rs/maint-grep-word-regexp-fix (Sat May 23 13:45:26 2009 +0200) 1 commit\n + grep: fix word-regexp at the beginning of lines\n\n* mm/apply-double-slash (Thu May 21 14:25:11 2009 +0200) 1 commit\n + apply: handle filenames with double slashes better\n\n* bc/old-iconv (Fri May 22 18:47:06 2009 -0500) 10 commits\n + t8005: convert CP1251 character set to ISO8859-5\n + t8005: use more portable character encoding names\n + t5100: use ancient encoding syntax for backwards compatibility\n + t9301: use ISO8859-1 rather than ISO-8859-1\n + t3901: Use ISO8859-1 instead of ISO-8859-1 for backward\n   compatibility\n + t3901: avoid negation on right hand side of '|'\n + builtin-mailinfo.c: use \"ISO8859-1\" instead of \"latin1\" as\n   fallback encoding\n + builtin-mailinfo.c: compare character encodings case insensitively\n + Use 'UTF-8' rather than 'utf-8' everywhere for backward\n   compatibility\n + t3900: use ancient iconv names for backward compatibility\n\n* sb/show-branch-parse-options (Thu May 21 00:33:18 2009 -0700) 3 commits\n + show-branch: migrate to parse-options API\n + Merge branch 'mh/show-branch-color' into sb/show-branch-parse-\n   options\n + parse-options: add PARSE_OPT_LITERAL_ARGHELP for complicated\n   argh's\n\n* sb/maint-1.6.2-opt-filename-fix (Sat May 23 11:53:11 2009 -0700) 2 commits\n + apply, fmt-merge-msg: use relative filenames\n + commit: -F overrides -t\n\n* jc/solaris-0811 (Fri May 22 22:55:31 2009 -0700) 2 commits\n - OpenSolaris 200811 (SunOS 5.11) does not want OLD_ICONV\n - Teach Solaris that _XOPEN_SOURCE=600 really menas XPG6\n\n* mw/send-email (Mon Apr 13 13:23:52 2009 -0500) 6 commits\n + send-email: Remove superfluous `my $editor = ...'\n + send-email: 'References:' should only reference what is sent\n + send-email: Handle \"GIT:\" rather than \"GIT: \" during --compose\n + Docs: send-email: --smtp-server-port can take symbolic ports\n + Docs: send-email: Refer to CONFIGURATION section for\n   sendemail.multiedit\n + Docs: send-email: Put options back into alphabetical order\n\n* jc/mktree (Thu May 14 15:49:10 2009 -0700) 9 commits\n + mktree: validate entry type in input\n + mktree --batch: build more than one tree object\n + mktree --missing: updated usage message and man page\n + mktree --missing: allow missing objects\n + t1010: add mktree test\n + mktree: do not barf on a submodule commit\n + builtin-mktree.c: use a helper function to handle one line of\n   input\n + mktree: use parse-options\n + build-in git-mktree\n\n* jc/maint-add-p-coalesce-fix (Sat May 16 10:48:23 2009 -0700) 2 commits\n + Revert \"git-add--interactive: remove hunk coalescing\"\n + Splitting a hunk that adds a line at the top fails in \"add -p\"\n\n* sb/format-patch-parseopt (Sat May 16 02:24:46 2009 -0700) 1 commit\n + format-patch: migrate to parse-options API\n\n* cc/bisect (Sun May 17 17:36:46 2009 +0200) 3 commits (early part)\n + bisect: check ancestors without forking a \"git rev-list\" process\n + commit: add function to unparse a commit and its parents\n + bisect: rework some rev related functions to make them more\n   reusable\n\n----------------------------------------------------------------\n[Stalled and may need help and prodding to go forward]\n\n* jh/notes (Sat May 16 13:44:17 2009 +0200) 5 commits\n - Teach \"-m <msg>\" and \"-F <file>\" to \"git notes edit\"\n - Add an expensive test for git-notes\n - Speed up git notes lookup\n - Add a script to edit/inspect notes\n - Introduce commit notes\n\nDscho asked about the performance implications of this; I do not think I\nsaw any progress on that yet...\n\n* ph/submodule-rebase (Fri Apr 24 09:06:38 2009 +1000) 1 commit\n + git-submodule: add support for --rebase.\n\nThere was a discussion on --rebase vs --merge and needs for unified\nconfiguration variable handling for this patch...\n\n* lt/read-directory (Fri May 15 12:01:29 2009 -0700) 3 commits\n - Add initial support for pathname conversion to UTF-8\n - read_directory(): infrastructure for pathname character set\n   conversion\n - Add 'fill_directory()' helper function for directory traversal\n\nBefore adding the real \"conversion\", this needs a few real fixups, I\nthink.  For example there is one hardcoded array that is used without\nbounds check.\n\n* ar/maint-1.6.2-merge-recursive-d-f (Mon May 11 21:25:36 2009 +0200) 2 commits\n - Fix for a merge where a branch has an F->D transition\n - Add a reminder test case for a merge with F/D transition\n\nAlthough the reported breakage is covered with the patch, Alex feels the\nsolution unsatisfactory. Cleaning up D/F conflict handling in merge-recursive\nmay be long overdue but seems to be a hard problem.\n\n* ps/blame (Thu Mar 12 21:30:03 2009 +1100) 1 commit\n - blame.c: start libifying the blame infrastructure\n\nA few minor point remains in this initial one.  I hate to do these minor\nfix-ups myself, but I may end up doing so...\n\n* jc/log-tz (Tue Mar 3 00:45:37 2009 -0800) 1 commit\n - Allow --date=local --date=other-format to work as expected\n\nThe one I posted had a few corner-case bugs that was caught with the test\nsuite; this one has them fixed.  People did not like the UI so it is kept\nout of 'next'\n\n* jc/merge-convert (Mon Jan 26 16:45:01 2009 -0800) 1 commit\n - git-merge-file: allow converting the results for the work tree\n\nThis is a feature waiting for a user.\n\nWe did not give scripted Porcelains a way to say \"this temporary file I am\nusing for merging is for this path, so use the core.autocrlf and attributes\nrules for that final path\".  Instead, merge-file simply wrote out the\ndata in the canonical repository representation.\n\nrerere has the same issue, but it is a lot worse.  It reads the three\nfiles (preimage, postimage and thisimage) from the work tree in the work\ntree representation, merges them without converting them to the canonical\nrepresentation first but inserts the conflict markers with the canonical\nrepresentation and writes the resulting mess out.  It needs to be fixed to\nread with convert_to_git(), merge them while they are still in the\ncanonical representation and possibly add conflict markers, and then write\nthe results out after convert_to_working_tree().  It also needs to write\nin binary mode as well.\n\n* db/foreign-scm (Tue Mar 24 23:04:12 2009 -0400) 3 commits\n - Add option for using a foreign VCS\n - Document details of transport function APIs\n - Allow late reporting of fetched hashes\n\n* hv/cvsps-tests (Sun Apr 5 01:40:50 2009 -0700) 8 commits\n - t/t9600: remove exit after test_done\n - cvsimport: extend testcase about patchset order to contain\n   branches\n - cvsimport: add test illustrating a bug in cvsps\n - Add a test of \"git cvsimport\"'s handling of tags and branches\n - Add some tests of git-cvsimport's handling of vendor branches\n - Test contents of entire cvsimported \"master\" tree contents\n - Use CVS's -f option if available (ignore user's ~/.cvsrc file)\n - Start a library for cvsimport-related tests\n\n----------------------------------------------------------------\n[Actively cooking]\n\n* da/araxis-mergetool (Sun May 24 00:24:41 2009 +0000) 1 commit\n + mergetool--lib: add support for araxis merge\n\n* jc/cache-tree (Fri May 22 23:14:25 2009 -0700) 5 commits\n + Avoid \"diff-index --cached\" optimization under --find-copies-\n   harder\n + Optimize \"diff-index --cached\" using cache-tree\n + t4007: modernize the style\n + cache-tree.c::cache_tree_find(): simplify internal API\n + write-tree --ignore-cache-tree\n\n* cb/maint-1.6.0-xdl-merge-fix (Mon May 25 01:21:14 2009 +0100) 2 commits\n - Change xdl_merge to generate output even for null merges\n - t6023: merge-file fails to output anything for a degenerate merge\n\nSoon in 'next';\n\n* jc/diff-whitespace-only-status (Sat May 23 01:15:35 2009 -0700) 2 commits\n - diff: Rename QUIET internal option to QUICK\n - diff: change semantics of \"ignore whitespace\" options\n\n* cc/bisect (Thu May 28 23:21:16 2009 +0200) 2 commits\n - bisect: display first bad commit without forking a new process\n - bisect: drop unparse_commit() and use clear_commit_marks()\n\nSoon in 'next';\n\n* rc/http-push (Sat May 30 01:59:50 2009 +0800) 21 commits\n - http*: add helper methods for fetching objects (loose)\n - http*: add helper methods for fetching packs\n - http: use new http API in fetch_index()\n - http*: add http_get_info_packs\n - Use the new http API in fetch_symref()\n - Use the new http API in update_remote_info_refs()\n - Use the new http API in http_fetch_ref()\n - Use the new http API in get_refs_via_curl()\n - Two new functions for the http API\n - http: create function end_url_with_slash\n - http*: move common variables and macros to http.[ch]\n - Some cleanup in get_refs_via_curl()\n - Don't expect verify_pack() callers to set pack_size\n - http-push: do not SEGV after fetching a bad pack idx file\n - http*: copy string returned by sha1_to_hex\n - http-walker: verify remote packs\n - http-push, http-walker: style fixes\n - http-push: fix missing \"#ifdef USE_CURL_MULTI\" around\n   \"is_running_queue\"\n - http-push: send out fetch requests on queue\n - t5540-http-push: test fetching of packed objects\n - t5540-http-push: test fetching of loose objects\n\nUpdated (but not yet with the \"slot->local = NULL\" patch)\n\n* cc/replace (Wed May 27 07:14:09 2009 +0200) 14 commits\n - t6050: check pushing something based on a replaced commit\n - Documentation: add documentation for \"git replace\"\n - Add git-replace to .gitignore\n - builtin-replace: use \"usage_msg_opt\" to give better error messages\n - parse-options: add new function \"usage_msg_opt\"\n - builtin-replace: teach \"git replace\" to actually replace\n - Add new \"git replace\" command\n - environment: add global variable to disable replacement\n - mktag: call \"check_sha1_signature\" with the replacement sha1\n - replace_object: add a test case\n - object: call \"check_sha1_signature\" with the replacement sha1\n - sha1_file: add a \"read_sha1_file_repl\" function\n - replace_object: add mechanism to replace objects found in\n   \"refs/replace/\"\n - refs: add a \"for_each_replace_ref\" function\n\nRebased to master.\n\n----------------------------------------------------------------\n[On Hold]\n\n* jc/deny-delete-current-1.7.0 (Mon Feb 9 00:19:46 2009 -0800) 1 commit\n - receive-pack: default receive.denyDeleteCurrent to refuse\n\n* jc/refuse-push-to-current-1.7.0 (Wed Feb 11 02:28:03 2009 -0800) 1 commit\n - Refuse updating the current branch in a non-bare repository via\n   push\n\nThese are for 1.7.0, but the messages when they trigger together may need\nto be rethought.\n"},{"id":"115207","messageId":"iHgBjpVVWguPJEPP4Ongi5IDGr3NDPAyUgAg5Ticr0KHPFiQTrqgpg@cipher.nrlssc.navy.mil","threadId":"19623","inReplyTo":"7v63fgpwyd.fsf@alter.siamese.dyndns.org","subject":"Re: What's cooking in git.git (May 2009, #04; Sun, 31)","fromName":"Brandon Casey","fromEmail":"casey@nrlssc.navy.mil","sentAt":"2009-06-01T16:05:16Z","receivedAt":"2009-06-01T16:05:16Z","isPatch":false,"sender":{"key":"drafnel@gmail.com","avatar":"https://avatars.githubusercontent.com/u/921167?v=4"},"body":"Junio C Hamano wrote:\n> Here are the topics that have been cooking.  Commits prefixed with '-' are\n> only in 'pu' while commits prefixed with '+' are in 'next'.  The ones\n> marked with '.' do not appear in any of the branches, but I am still\n> holding onto them.\n> \n> The topics list the commits in reverse chronological order.  The topics\n> meant to be merged to the maintenance series have \"maint-\" in their names.\n> \n> ----------------------------------------------------------------\n> [New Topics]\n> \n> All of these are soon to be in 'next'.\n> \n> * bc/solaris (Wed May 27 21:17:08 2009 -0500) 4 commits\n>  - Makefile: introduce SANE_TOOL_PATH for prepending required\n>    elements to PATH\n>  - Makefile: add section for SunOS 5.7\n>  - Makefile: add NEEDS_RESOLV to optionally add -lresolv to compile\n>    arguments\n>  - Makefile: use /usr/ucb/install on SunOS platforms rather than\n>    ginstall\n\nIf you haven't already merged this to 'next', then give me some time\nand I'll resubmit a new series based on the feedback from you and\nJeff.\n\nJeff pointed out that HSTRERROR only has any effect when NO_IPV6 is\nset.  So, NEEDS_RESOLV is really only necessary on Solaris versions\nwhich must set NO_IPV6.\n\nYou suggested changes to git-compat-util.h for handling compiling on\nSolaris with/without c99 compiler.\n\nThe bottom patch that switches to /usr/ucb/install is fine as-is.\n\nIf the series is already applied, no big deal, I'll just work on top of that.\n\n-brandon\n"},{"id":"115289","messageId":"1243983552-24810-1-git-send-email-johan@herland.net","threadId":"19623","inReplyTo":"7v63fgpwyd.fsf@alter.siamese.dyndns.org","subject":"[PATCH 0/2] \"git submodule update\" enhancements (Was: What's cooking in git.git (May 2009, #04; Sun, 31))","fromName":"Johan Herland","fromEmail":"johan@herland.net","sentAt":"2009-06-02T22:59:10Z","receivedAt":"2009-06-02T22:59:10Z","isPatch":true,"sender":{"key":"johan@herland.net","avatar":"https://avatars.githubusercontent.com/u/547031?v=4"},"body":"> [Stalled and may need help and prodding to go forward]\n>\n> * ph/submodule-rebase (Fri Apr 24 09:06:38 2009 +1000) 1 commit\n>  + git-submodule: add support for --rebase.\n>\n> There was a discussion on --rebase vs --merge and needs for unified\n> configuration variable handling for this patch...\n\nHere is my previous patch, split in two, so as not to hold back the\nintroduction of \"git submodule update --rebase\": The first patch\nchanges the associated config variable from \"submodule.<name>.rebase\"\nto \"submodule.<name>.update\", and the second patch introduces\n\"git submodule update --merge\".\n\nAFAIK, nobody objects to the first patch, so that one should be safe\nto apply.\n\nAs for the second patch, Dscho has argued against it, although he\nhas not yet responded to my last email from a week ago. Nobody\n(except me) has explicitly supported the patch, although both Avery\nand yourself has questioned Dscho's arguments.\n\nNot sure what I can do to bring the discussion toward a conclusion...\n\n\n...Johan\n\nJohan Herland (2):\n  Rename submodule.<name>.rebase to submodule.<name>.update\n  git-submodule: add support for --merge.\n\n Documentation/git-submodule.txt |   19 ++++++++--\n Documentation/gitmodules.txt    |   12 +++++-\n git-submodule.sh                |   43 ++++++++++++++--------\n t/t7406-submodule-update.sh     |   76 ++++++++++++++++++++++++++++++++++-----\n 4 files changed, 119 insertions(+), 31 deletions(-)\n"},{"id":"115290","messageId":"1243983552-24810-2-git-send-email-johan@herland.net","threadId":"19623","inReplyTo":"7v63fgpwyd.fsf@alter.siamese.dyndns.org","subject":"[PATCH 1/2] Rename submodule.<name>.rebase to submodule.<name>.update","fromName":"Johan Herland","fromEmail":"johan@herland.net","sentAt":"2009-06-02T22:59:11Z","receivedAt":"2009-06-02T22:59:11Z","isPatch":true,"sender":{"key":"johan@herland.net","avatar":"https://avatars.githubusercontent.com/u/547031?v=4"},"body":"The addition of \"submodule.<name>.rebase\" demonstrates the usefulness of\nalternatives to the default behaviour of \"git submodule update\". However,\nby naming the config variable \"submodule.<name>.rebase\", and making it a\nboolean choice, we are artificially constraining future git versions that\nmay want to add _more_ alternatives than just \"rebase\".\n\nTherefore, while \"submodule.<name>.rebase\" are not yet in a stable git\nrelease, future-proof it, by changing it from\n\n  submodule.<name>.rebase = true/false\n\nto\n\n  submodule.<name>.update = checkout/rebase\n\nwhere \"checkout\" specifies the default behaviour of \"git submodule update\"\n(checking out the new commit to a detached HEAD), and \"rebase\" specifies\nthe --rebase behaviour (where the current local branch in the submodule is\nrebase onto the new commit). Thus .update == checkout is .rebase == false,\nand .update == rebase is equivalent to .rebase == false. Finally, leaving\n.update unset is equivalent to leaving .rebase unset.\n\nIn future git versions, other alternatives to \"git submodule update\"\nbehaviour can be included by adding them to the list of allowable values\nfor the submodule.<name>.update variable.\n\nSigned-off-by: Johan Herland <johan@herland.net>\n---\n Documentation/git-submodule.txt |    4 ++--\n Documentation/gitmodules.txt    |   10 ++++++++--\n git-submodule.sh                |   32 +++++++++++++++++---------------\n t/t7406-submodule-update.sh     |   16 ++++++++--------\n 4 files changed, 35 insertions(+), 27 deletions(-)\n\ndiff --git a/Documentation/git-submodule.txt b/Documentation/git-submodule.txt\nindex acd16ac..cd8e861 100644\n--- a/Documentation/git-submodule.txt\n+++ b/Documentation/git-submodule.txt\n@@ -116,7 +116,7 @@ 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 unless '--rebase' is\n-\tspecified or the key `submodule.$name.rebase` is set to `true`.\n+\tspecified or the key `submodule.$name.update` is set to\t`rebase`.\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@@ -186,7 +186,7 @@ OPTIONS\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+\tIf the key `submodule.$name.update` is set to `rebase`, this option is\n \timplicit.\n \n --reference <repository>::\ndiff --git a/Documentation/gitmodules.txt b/Documentation/gitmodules.txt\nindex 7c22c40..1b67f0a 100644\n--- a/Documentation/gitmodules.txt\n+++ b/Documentation/gitmodules.txt\n@@ -30,8 +30,14 @@ 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+submodule.<name>.update::\n+\tDefines what to do when the submodule is updated by the superproject.\n+\tIf 'checkout' (the default), the new commit specified in the\n+\tsuperproject will be checked out in the submodule on a detached HEAD.\n+\tIf 'rebase', the current branch of the submodule will be rebased onto\n+\tthe commit specified in the superproject.\n+\tThis config option is overridden if 'git submodule update' is given\n+\tthe '--rebase' option.\n \n \n EXAMPLES\ndiff --git a/git-submodule.sh b/git-submodule.sh\nindex bbca183..19a3a84 100755\n--- a/git-submodule.sh\n+++ b/git-submodule.sh\n@@ -18,7 +18,7 @@ quiet=\n reference=\n cached=\n nofetch=\n-rebase=\n+update=\n \n #\n # print stuff on stdout unless -q was specified\n@@ -311,10 +311,10 @@ 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+\t\tupd=\"$(git config -f .gitmodules submodule.\"$name\".update)\"\n+\t\ttest -z \"$upd\" ||\n+\t\tgit config submodule.\"$name\".update \"$upd\" ||\n+\t\tdie \"Failed to register update mode for submodule path '$path'\"\n \n \t\tsay \"Submodule '$name' ($url) registered for path '$path'\"\n \tdone\n@@ -345,7 +345,7 @@ cmd_update()\n \t\t\t;;\n \t\t-r|--rebase)\n \t\t\tshift\n-\t\t\trebase=true\n+\t\t\tupdate=\"rebase\"\n \t\t\t;;\n \t\t--reference)\n \t\t\tcase \"$2\" in '') usage ;; esac\n@@ -379,7 +379,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\tupdate_module=$(git config submodule.\"$name\".update)\n \t\tif test -z \"$url\"\n \t\tthen\n \t\t\t# Only mention uninitialized submodules when its\n@@ -400,9 +400,9 @@ 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\tif ! test -z \"$update\"\n \t\tthen\n-\t\t\trebase_module=true\n+\t\t\tupdate_module=$update\n \t\tfi\n \n \t\tif test \"$subsha1\" != \"$sha1\"\n@@ -420,16 +420,18 @@ cmd_update()\n \t\t\t\tdie \"Unable to fetch in submodule path '$path'\"\n \t\t\tfi\n \n-\t\t\tif test true = \"$rebase_module\"\n-\t\t\tthen\n-\t\t\t\tcommand=\"git-rebase\"\n+\t\t\tcase \"$update_module\" in\n+\t\t\trebase)\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\t;;\n+\t\t\t*)\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+\t\t\t\t;;\n+\t\t\tesac\n \n \t\t\t(unset GIT_DIR; cd \"$path\" && $command \"$sha1\") ||\n \t\t\tdie \"Unable to $action '$sha1' in submodule path '$path'\"\ndiff --git a/t/t7406-submodule-update.sh b/t/t7406-submodule-update.sh\nindex 3442c05..0773fe4 100755\n--- a/t/t7406-submodule-update.sh\n+++ b/t/t7406-submodule-update.sh\n@@ -76,9 +76,9 @@ test_expect_success 'submodule update --rebase staying on master' '\n \t)\n '\n \n-test_expect_success 'submodule update - rebase true in .git/config' '\n+test_expect_success 'submodule update - rebase in .git/config' '\n \t(cd super &&\n-\t git config submodule.submodule.rebase true\n+\t git config submodule.submodule.update rebase\n \t) &&\n \t(cd super/submodule &&\n \t  git reset --hard HEAD~1\n@@ -93,9 +93,9 @@ test_expect_success 'submodule update - rebase true in .git/config' '\n \t)\n '\n \n-test_expect_success 'submodule update - rebase false in .git/config but --rebase given' '\n+test_expect_success 'submodule update - checkout in .git/config but --rebase given' '\n \t(cd super &&\n-\t git config submodule.submodule.rebase false\n+\t git config submodule.submodule.update checkout\n \t) &&\n \t(cd super/submodule &&\n \t  git reset --hard HEAD~1\n@@ -110,9 +110,9 @@ test_expect_success 'submodule update - rebase false in .git/config but --rebase\n \t)\n '\n \n-test_expect_success 'submodule update - rebase false in .git/config' '\n+test_expect_success 'submodule update - checkout in .git/config' '\n \t(cd super &&\n-\t git config submodule.submodule.rebase false\n+\t git config submodule.submodule.update checkout\n \t) &&\n \t(cd super/submodule &&\n \t  git reset --hard HEAD^\n@@ -131,9 +131,9 @@ 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 config submodule.rebasing.update rebase &&\n \t git submodule init rebasing &&\n-\t test true = $(git config --bool submodule.rebasing.rebase)\n+\t test \"rebase\" = $(git config submodule.rebasing.update)\n \t)\n '\n \n-- \n1.6.3.rc0.1.gf800\n"},{"id":"115291","messageId":"1243983552-24810-3-git-send-email-johan@herland.net","threadId":"19623","inReplyTo":"7v63fgpwyd.fsf@alter.siamese.dyndns.org","subject":"[PATCH 2/2] git-submodule: add support for --merge.","fromName":"Johan Herland","fromEmail":"johan@herland.net","sentAt":"2009-06-02T22:59:12Z","receivedAt":"2009-06-02T22:59:12Z","isPatch":true,"sender":{"key":"johan@herland.net","avatar":"https://avatars.githubusercontent.com/u/547031?v=4"},"body":"'git submodule update --merge' merges the commit referenced by the\nsuperproject into your local branch, instead of checking it out on\na detached HEAD.\n\nAs evidenced by the addition of \"git submodule update --rebase\", it\nis useful to provide alternatives to the default 'checkout' behaviour\nof \"git submodule update\". One such alternative is, when updating a\nsubmodule to a new commit, to merge that commit into the current\nlocal branch in that submodule. This is useful in workflows where\nyou want to update your submodule from its upstream, but you cannot\nuse --rebase, because you have downstream people working on top of\nyour submodule branch, and you don't want to disrupt their work.\n\nSigned-off-by: Johan Herland <johan@herland.net>\n---\n Documentation/git-submodule.txt |   17 +++++++++--\n Documentation/gitmodules.txt    |    6 ++-\n git-submodule.sh                |   11 ++++++-\n t/t7406-submodule-update.sh     |   60 ++++++++++++++++++++++++++++++++++++++-\n 4 files changed, 87 insertions(+), 7 deletions(-)\n\ndiff --git a/Documentation/git-submodule.txt b/Documentation/git-submodule.txt\nindex cd8e861..1cbb181 100644\n--- a/Documentation/git-submodule.txt\n+++ b/Documentation/git-submodule.txt\n@@ -13,7 +13,7 @@ SYNOPSIS\n \t      [--reference <repository>] [--] <repository> <path>\n 'git submodule' [--quiet] status [--cached] [--] [<path>...]\n 'git submodule' [--quiet] init [--] [<path>...]\n-'git submodule' [--quiet] update [--init] [-N|--no-fetch] [--rebase]\n+'git submodule' [--quiet] update [--init] [-N|--no-fetch] [--rebase|--merge]\n \t      [--reference <repository>] [--] [<path>...]\n 'git submodule' [--quiet] summary [--summary-limit <n>] [commit] [--] [<path>...]\n 'git submodule' [--quiet] foreach <command>\n@@ -115,8 +115,9 @@ 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 unless '--rebase' is\n-\tspecified or the key `submodule.$name.update` is set to\t`rebase`.\n+\tThis will make the submodules HEAD be detached unless '--rebase' or\n+\t'--merge' is specified or the key `submodule.$name.update` is set to\n+\t`rebase` or `merge`.\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@@ -189,6 +190,16 @@ OPTIONS\n \tIf the key `submodule.$name.update` is set to `rebase`, this option is\n \timplicit.\n \n+--merge::\n+\tThis option is only valid for the update command.\n+\tMerge the commit recorded in the superproject into the current branch\n+\tof the submodule. If this option is given, the submodule's HEAD will\n+\tnot be detached. If a merge failure prevents this process, you will\n+\thave to resolve the resulting conflicts within the submodule with the\n+\tusual conflict resolution tools.\n+\tIf the key `submodule.$name.update` is set to `merge`, this option is\n+\timplicit.\n+\n --reference <repository>::\n \tThis option is only valid for add and update commands.  These\n \tcommands sometimes need to clone a remote repository. In this case,\ndiff --git a/Documentation/gitmodules.txt b/Documentation/gitmodules.txt\nindex 1b67f0a..5daf750 100644\n--- a/Documentation/gitmodules.txt\n+++ b/Documentation/gitmodules.txt\n@@ -35,9 +35,11 @@ submodule.<name>.update::\n \tIf 'checkout' (the default), the new commit specified in the\n \tsuperproject will be checked out in the submodule on a detached HEAD.\n \tIf 'rebase', the current branch of the submodule will be rebased onto\n-\tthe commit specified in the superproject.\n+\tthe commit specified in the superproject. If 'merge', the commit\n+\tspecified in the superproject will be merged into the current branch\n+\tin the submodule.\n \tThis config option is overridden if 'git submodule update' is given\n-\tthe '--rebase' option.\n+\tthe '--merge' or '--rebase' options.\n \n \n EXAMPLES\ndiff --git a/git-submodule.sh b/git-submodule.sh\nindex 19a3a84..2a1e73c 100755\n--- a/git-submodule.sh\n+++ b/git-submodule.sh\n@@ -5,7 +5,7 @@\n # Copyright (c) 2007 Lars Hjemli\n \n USAGE=\"[--quiet] [--cached] \\\n-[add [-b branch] <repo> <path>]|[status|init|update [-i|--init] [-N|--no-fetch]|summary [-n|--summary-limit <n>] [<commit>]] \\\n+[add [-b branch] <repo> <path>]|[status|init|update [-i|--init] [-N|--no-fetch] [--rebase|--merge]|summary [-n|--summary-limit <n>] [<commit>]] \\\n [--] [<path>...]|[foreach <command>]|[sync [--] [<path>...]]\"\n OPTIONS_SPEC=\n . git-sh-setup\n@@ -347,6 +347,10 @@ cmd_update()\n \t\t\tshift\n \t\t\tupdate=\"rebase\"\n \t\t\t;;\n+\t\t-m|--merge)\n+\t\t\tshift\n+\t\t\tupdate=\"merge\"\n+\t\t\t;;\n \t\t--reference)\n \t\t\tcase \"$2\" in '') usage ;; esac\n \t\t\treference=\"--reference=$2\"\n@@ -426,6 +430,11 @@ cmd_update()\n \t\t\t\taction=\"rebase\"\n \t\t\t\tmsg=\"rebased onto\"\n \t\t\t\t;;\n+\t\t\tmerge)\n+\t\t\t\tcommand=\"git merge\"\n+\t\t\t\taction=\"merge\"\n+\t\t\t\tmsg=\"merged in\"\n+\t\t\t\t;;\n \t\t\t*)\n \t\t\t\tcommand=\"git checkout $force -q\"\n \t\t\t\taction=\"checkout\"\ndiff --git a/t/t7406-submodule-update.sh b/t/t7406-submodule-update.sh\nindex 0773fe4..2d33d9e 100755\n--- a/t/t7406-submodule-update.sh\n+++ b/t/t7406-submodule-update.sh\n@@ -6,7 +6,7 @@\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+submodule and \"git submodule update --rebase/--merge\" does not detach the HEAD.\n '\n \n . ./test-lib.sh\n@@ -76,6 +76,20 @@ test_expect_success 'submodule update --rebase staying on master' '\n \t)\n '\n \n+test_expect_success 'submodule update --merge staying on master' '\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 --merge submodule &&\n+\t cd submodule &&\n+\t compare_head\n+\t)\n+'\n+\n test_expect_success 'submodule update - rebase in .git/config' '\n \t(cd super &&\n \t git config submodule.submodule.update rebase\n@@ -110,6 +124,40 @@ test_expect_success 'submodule update - checkout in .git/config but --rebase giv\n \t)\n '\n \n+test_expect_success 'submodule update - merge in .git/config' '\n+\t(cd super &&\n+\t git config submodule.submodule.update merge\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 - checkout in .git/config but --merge given' '\n+\t(cd super &&\n+\t git config submodule.submodule.update checkout\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 --merge submodule &&\n+\t cd submodule &&\n+\t compare_head\n+\t)\n+'\n+\n test_expect_success 'submodule update - checkout in .git/config' '\n \t(cd super &&\n \t git config submodule.submodule.update checkout\n@@ -137,4 +185,14 @@ test_expect_success 'submodule init picks up rebase' '\n \t)\n '\n \n+test_expect_success 'submodule init picks up merge' '\n+\t(cd super &&\n+\t git config submodule.merging.url git://non-existing/git &&\n+\t git config submodule.merging.path does-not-matter &&\n+\t git config submodule.merging.update merge &&\n+\t git submodule init merging &&\n+\t test \"merge\" = $(git config submodule.merging.update)\n+\t)\n+'\n+\n test_done\n-- \n1.6.3.rc0.1.gf800\n"},{"id":"115297","messageId":"20090603001553.GB27149@dingo.bne.redhat.com","threadId":"19623","inReplyTo":"1243983552-24810-2-git-send-email-johan@herland.net","subject":"Re: [PATCH 1/2] Rename submodule.<name>.rebase to submodule.<name>.update","fromName":"Peter Hutterer","fromEmail":"peter.hutterer@who-t.net","sentAt":"2009-06-03T00:15:54Z","receivedAt":"2009-06-03T00:15:54Z","isPatch":true,"sender":{"key":"peter.hutterer@who-t.net","avatar":"https://avatars.githubusercontent.com/u/1487352?v=4"},"body":"On Wed, Jun 03, 2009 at 12:59:11AM +0200, Johan Herland wrote:\n> The addition of \"submodule.<name>.rebase\" demonstrates the usefulness of\n> alternatives to the default behaviour of \"git submodule update\". However,\n> by naming the config variable \"submodule.<name>.rebase\", and making it a\n> boolean choice, we are artificially constraining future git versions that\n> may want to add _more_ alternatives than just \"rebase\".\n> \n> Therefore, while \"submodule.<name>.rebase\" are not yet in a stable git\n> release, future-proof it, by changing it from\n> \n>   submodule.<name>.rebase = true/false\n> \n> to\n> \n>   submodule.<name>.update = checkout/rebase\n> \n> where \"checkout\" specifies the default behaviour of \"git submodule update\"\n> (checking out the new commit to a detached HEAD), and \"rebase\" specifies\n> the --rebase behaviour (where the current local branch in the submodule is\n> rebase onto the new commit). Thus .update == checkout is .rebase == false,\n> and .update == rebase is equivalent to .rebase == false. Finally, leaving\n> .update unset is equivalent to leaving .rebase unset.\n> \n> In future git versions, other alternatives to \"git submodule update\"\n> behaviour can be included by adding them to the list of allowable values\n> for the submodule.<name>.update variable.\n> \n> Signed-off-by: Johan Herland <johan@herland.net>\n> ---\n>  Documentation/git-submodule.txt |    4 ++--\n>  Documentation/gitmodules.txt    |   10 ++++++++--\n>  git-submodule.sh                |   32 +++++++++++++++++---------------\n>  t/t7406-submodule-update.sh     |   16 ++++++++--------\n>  4 files changed, 35 insertions(+), 27 deletions(-)\n> \n> diff --git a/Documentation/git-submodule.txt b/Documentation/git-submodule.txt\n> index acd16ac..cd8e861 100644\n> --- a/Documentation/git-submodule.txt\n> +++ b/Documentation/git-submodule.txt\n> @@ -116,7 +116,7 @@ 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 unless '--rebase' is\n> -\tspecified or the key `submodule.$name.rebase` is set to `true`.\n> +\tspecified or the key `submodule.$name.update` is set to\t`rebase`.\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> @@ -186,7 +186,7 @@ OPTIONS\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> +\tIf the key `submodule.$name.update` is set to `rebase`, this option is\n>  \timplicit.\n>  \n>  --reference <repository>::\n> diff --git a/Documentation/gitmodules.txt b/Documentation/gitmodules.txt\n> index 7c22c40..1b67f0a 100644\n> --- a/Documentation/gitmodules.txt\n> +++ b/Documentation/gitmodules.txt\n> @@ -30,8 +30,14 @@ 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> +submodule.<name>.update::\n> +\tDefines what to do when the submodule is updated by the superproject.\n> +\tIf 'checkout' (the default), the new commit specified in the\n> +\tsuperproject will be checked out in the submodule on a detached HEAD.\n> +\tIf 'rebase', the current branch of the submodule will be rebased onto\n> +\tthe commit specified in the superproject.\n> +\tThis config option is overridden if 'git submodule update' is given\n> +\tthe '--rebase' option.\n>  \n>  \n>  EXAMPLES\n> diff --git a/git-submodule.sh b/git-submodule.sh\n> index bbca183..19a3a84 100755\n> --- a/git-submodule.sh\n> +++ b/git-submodule.sh\n> @@ -18,7 +18,7 @@ quiet=\n>  reference=\n>  cached=\n>  nofetch=\n> -rebase=\n> +update=\n>  \n>  #\n>  # print stuff on stdout unless -q was specified\n> @@ -311,10 +311,10 @@ 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> +\t\tupd=\"$(git config -f .gitmodules submodule.\"$name\".update)\"\n> +\t\ttest -z \"$upd\" ||\n> +\t\tgit config submodule.\"$name\".update \"$upd\" ||\n> +\t\tdie \"Failed to register update mode for submodule path '$path'\"\n>  \n>  \t\tsay \"Submodule '$name' ($url) registered for path '$path'\"\n>  \tdone\n> @@ -345,7 +345,7 @@ cmd_update()\n>  \t\t\t;;\n>  \t\t-r|--rebase)\n>  \t\t\tshift\n> -\t\t\trebase=true\n> +\t\t\tupdate=\"rebase\"\n>  \t\t\t;;\n>  \t\t--reference)\n>  \t\t\tcase \"$2\" in '') usage ;; esac\n> @@ -379,7 +379,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\tupdate_module=$(git config submodule.\"$name\".update)\n>  \t\tif test -z \"$url\"\n>  \t\tthen\n>  \t\t\t# Only mention uninitialized submodules when its\n> @@ -400,9 +400,9 @@ 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\tif ! test -z \"$update\"\n>  \t\tthen\n> -\t\t\trebase_module=true\n> +\t\t\tupdate_module=$update\n>  \t\tfi\n>  \n>  \t\tif test \"$subsha1\" != \"$sha1\"\n> @@ -420,16 +420,18 @@ cmd_update()\n>  \t\t\t\tdie \"Unable to fetch in submodule path '$path'\"\n>  \t\t\tfi\n>  \n> -\t\t\tif test true = \"$rebase_module\"\n> -\t\t\tthen\n> -\t\t\t\tcommand=\"git-rebase\"\n> +\t\t\tcase \"$update_module\" in\n> +\t\t\trebase)\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\t;;\n> +\t\t\t*)\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> +\t\t\t\t;;\n> +\t\t\tesac\n>  \n>  \t\t\t(unset GIT_DIR; cd \"$path\" && $command \"$sha1\") ||\n>  \t\t\tdie \"Unable to $action '$sha1' in submodule path '$path'\"\n> diff --git a/t/t7406-submodule-update.sh b/t/t7406-submodule-update.sh\n> index 3442c05..0773fe4 100755\n> --- a/t/t7406-submodule-update.sh\n> +++ b/t/t7406-submodule-update.sh\n> @@ -76,9 +76,9 @@ test_expect_success 'submodule update --rebase staying on master' '\n>  \t)\n>  '\n>  \n> -test_expect_success 'submodule update - rebase true in .git/config' '\n> +test_expect_success 'submodule update - rebase in .git/config' '\n>  \t(cd super &&\n> -\t git config submodule.submodule.rebase true\n> +\t git config submodule.submodule.update rebase\n>  \t) &&\n>  \t(cd super/submodule &&\n>  \t  git reset --hard HEAD~1\n> @@ -93,9 +93,9 @@ test_expect_success 'submodule update - rebase true in .git/config' '\n>  \t)\n>  '\n>  \n> -test_expect_success 'submodule update - rebase false in .git/config but --rebase given' '\n> +test_expect_success 'submodule update - checkout in .git/config but --rebase given' '\n>  \t(cd super &&\n> -\t git config submodule.submodule.rebase false\n> +\t git config submodule.submodule.update checkout\n>  \t) &&\n>  \t(cd super/submodule &&\n>  \t  git reset --hard HEAD~1\n> @@ -110,9 +110,9 @@ test_expect_success 'submodule update - rebase false in .git/config but --rebase\n>  \t)\n>  '\n>  \n> -test_expect_success 'submodule update - rebase false in .git/config' '\n> +test_expect_success 'submodule update - checkout in .git/config' '\n>  \t(cd super &&\n> -\t git config submodule.submodule.rebase false\n> +\t git config submodule.submodule.update checkout\n>  \t) &&\n>  \t(cd super/submodule &&\n>  \t  git reset --hard HEAD^\n> @@ -131,9 +131,9 @@ 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 config submodule.rebasing.update rebase &&\n>  \t git submodule init rebasing &&\n> -\t test true = $(git config --bool submodule.rebasing.rebase)\n> +\t test \"rebase\" = $(git config submodule.rebasing.update)\n>  \t)\n>  '\n>  \n> -- \n> 1.6.3.rc0.1.gf800\n\nI noticed this patch still leaves the --rebase commandline flag. Shouldn't\nthat be changed to --update=rebase for consistency?\n\nCheers,\n  Peter\n"},{"id":"115310","messageId":"7v4ouydp0q.fsf@alter.siamese.dyndns.org","threadId":"19623","inReplyTo":"20090603001553.GB27149@dingo.bne.redhat.com","subject":"Re: [PATCH 1/2] Rename submodule.<name>.rebase to submodule.<name>.update","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-06-03T02:33:57Z","receivedAt":"2009-06-03T02:33:57Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Peter Hutterer <peter.hutterer@who-t.net> writes:\n\n> On Wed, Jun 03, 2009 at 12:59:11AM +0200, Johan Herland wrote:\n> ...\n>> diff --git a/Documentation/git-submodule.txt b/Documentation/git-submodule.txt\n>> index acd16ac..cd8e861 100644\n>> --- a/Documentation/git-submodule.txt\n>> +++ b/Documentation/git-submodule.txt\n>> @@ -116,7 +116,7 @@ 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 unless '--rebase' is\n>> -\tspecified or the key `submodule.$name.rebase` is set to `true`.\n>> +\tspecified or the key `submodule.$name.update` is set to\t`rebase`.\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> ...\n> I noticed this patch still leaves the --rebase commandline flag. Shouldn't\n> that be changed to --update=rebase for consistency?\n\nIf we were to add many more (I think --update=merge was mentioned, but do\nwe have any other plausibly useful modes of operations?) options, it would\nmake sense to support --update=rebase; my impression from the previous\ndiscussion was that rebase would make sense for more people than other\nmodes would, so it also would make sense to keep --rebase as a shorthand,\nrather than forcing everybody to say --update=rebase for the sake of\nconsistency.\n\nYou did not have to quote the whole patch to say what you wanted to say,\nby the way.\n"},{"id":"115313","messageId":"200906030615.45791.markus.heidelberg@web.de","threadId":"19623","inReplyTo":"1243983552-24810-2-git-send-email-johan@herland.net","subject":"Re: [PATCH 1/2] Rename submodule.<name>.rebase to submodule.<name>.update","fromName":"Markus Heidelberg","fromEmail":"markus.heidelberg@web.de","sentAt":"2009-06-03T04:15:44Z","receivedAt":"2009-06-03T04:15:44Z","isPatch":true,"sender":{"key":"markus.heidelberg@web.de","avatar":"https://avatars.githubusercontent.com/u/6334512?v=4"},"body":"Johan Herland, 03.06.2009:\n> The addition of \"submodule.<name>.rebase\" demonstrates the usefulness of\n> alternatives to the default behaviour of \"git submodule update\". However,\n> by naming the config variable \"submodule.<name>.rebase\", and making it a\n> boolean choice, we are artificially constraining future git versions that\n> may want to add _more_ alternatives than just \"rebase\".\n> \n> Therefore, while \"submodule.<name>.rebase\" are not yet in a stable git\n> release, future-proof it, by changing it from\n> \n>   submodule.<name>.rebase = true/false\n> \n> to\n> \n>   submodule.<name>.update = checkout/rebase\n> \n> where \"checkout\" specifies the default behaviour of \"git submodule update\"\n> (checking out the new commit to a detached HEAD), and \"rebase\" specifies\n> the --rebase behaviour (where the current local branch in the submodule is\n> rebase onto the new commit). Thus .update == checkout is .rebase == false,\n> and .update == rebase is equivalent to .rebase == false. Finally, leaving\n                                                    ^^^^^\n.rebase == true\n\n> diff --git a/git-submodule.sh b/git-submodule.sh\n> @@ -400,9 +400,9 @@ 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\tif ! test -z \"$update\"\n\nIsn't this simpler: if test -n \"$update\"\nOTOH I think I have heard something about portability, but I'm not sure.\n\n> @@ -420,16 +420,18 @@ cmd_update()\n>  \t\t\t\tdie \"Unable to fetch in submodule path '$path'\"\n>  \t\t\tfi\n>  \n> -\t\t\tif test true = \"$rebase_module\"\n> -\t\t\tthen\n> -\t\t\t\tcommand=\"git-rebase\"\n> +\t\t\tcase \"$update_module\" in\n> +\t\t\trebase)\n> +\t\t\t\tcommand=\"git rebase\"\n\nI think it is common practice to use the dashed form in scripts and this\npatch shouldn't change it anyway.\n\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\t;;\n> +\t\t\t*)\n> +\t\t\t\tcommand=\"git checkout $force -q\"\n\nditto\n"},{"id":"115314","messageId":"200906030820.21372.johan@herland.net","threadId":"19623","inReplyTo":"200906030615.45791.markus.heidelberg@web.de","subject":"Re: [PATCH 1/2] Rename submodule.<name>.rebase to submodule.<name>.update","fromName":"Johan Herland","fromEmail":"johan@herland.net","sentAt":"2009-06-03T06:20:21Z","receivedAt":"2009-06-03T06:20:21Z","isPatch":true,"sender":{"key":"johan@herland.net","avatar":"https://avatars.githubusercontent.com/u/547031?v=4"},"body":"Hi,\n\nThanks for the feedback. Really appreciated!\n\nOn Wednesday 03 June 2009, Markus Heidelberg wrote:\n> Johan Herland, 03.06.2009:\n> > Therefore, while \"submodule.<name>.rebase\" are not yet in a stable git\n> > release, future-proof it, by changing it from\n> >\n> >   submodule.<name>.rebase = true/false\n> >\n> > to\n> >\n> >   submodule.<name>.update = checkout/rebase\n> >\n> > where \"checkout\" specifies the default behaviour of \"git submodule\n> > update\" (checking out the new commit to a detached HEAD), and \"rebase\"\n> > specifies the --rebase behaviour (where the current local branch in the\n> > submodule is rebase onto the new commit). Thus .update == checkout is\n> > .rebase == false, and .update == rebase is equivalent to .rebase ==\n> > false. Finally, leaving\n>   ^^^^^\n> .rebase == true\n\nIndeed. Thanks.\n\n> > diff --git a/git-submodule.sh b/git-submodule.sh\n> > @@ -400,9 +400,9 @@ 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\tif ! test -z \"$update\"\n>\n> Isn't this simpler: if test -n \"$update\"\n> OTOH I think I have heard something about portability, but I'm not sure.\n\nYes, \"test -n\" is simpler than \"! test -z\", but at an earlier occasion I was \ntold that \"test -n\" is not as portable as \"test -z\"...\n\n> > @@ -420,16 +420,18 @@ cmd_update()\n> >  \t\t\t\tdie \"Unable to fetch in submodule path '$path'\"\n> >  \t\t\tfi\n> >\n> > -\t\t\tif test true = \"$rebase_module\"\n> > -\t\t\tthen\n> > -\t\t\t\tcommand=\"git-rebase\"\n> > +\t\t\tcase \"$update_module\" in\n> > +\t\t\trebase)\n> > +\t\t\t\tcommand=\"git rebase\"\n>\n> I think it is common practice to use the dashed form in scripts and this\n> patch shouldn't change it anyway.\n\nI thought we were moving away from the dashed form altogether, both in \nscripts and in examples. Junio, is there an \"official\" position?\n\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\t;;\n> > +\t\t\t*)\n> > +\t\t\t\tcommand=\"git checkout $force -q\"\n>\n> ditto\n\nThanks for your comments, I'll send an updated patch.\n\n\nHave fun! :)\n\n...Johan\n\n-- \nJohan Herland, <johan@herland.net>\nwww.herland.net\n"},{"id":"115316","messageId":"1244010426-25535-1-git-send-email-johan@herland.net","threadId":"19623","inReplyTo":"200906030820.21372.johan@herland.net","subject":"[PATCH 1/2 v2] Rename submodule.<name>.rebase to submodule.<name>.update","fromName":"Johan Herland","fromEmail":"johan@herland.net","sentAt":"2009-06-03T06:27:06Z","receivedAt":"2009-06-03T06:27:06Z","isPatch":true,"sender":{"key":"johan@herland.net","avatar":"https://avatars.githubusercontent.com/u/547031?v=4"},"body":"The addition of \"submodule.<name>.rebase\" demonstrates the usefulness of\nalternatives to the default behaviour of \"git submodule update\". However,\nby naming the config variable \"submodule.<name>.rebase\", and making it a\nboolean choice, we are artificially constraining future git versions that\nmay want to add _more_ alternatives than just \"rebase\".\n\nTherefore, while \"submodule.<name>.rebase\" is not yet in a stable git\nrelease, future-proof it, by changing it from\n\n  submodule.<name>.rebase = true/false\n\nto\n\n  submodule.<name>.update = rebase/checkout\n\nwhere \"checkout\" specifies the default behaviour of \"git submodule update\"\n(checking out the new commit to a detached HEAD), and \"rebase\" specifies\nthe --rebase behaviour (where the current local branch in the submodule is\nrebase onto the new commit). Thus .update == checkout is equivalent to\n.rebase == false, and .update == rebase is equivalent to .rebase == true.\nFinally, leaving .update unset is equivalent to leaving .rebase unset.\n\nIn future git versions, other alternatives to \"git submodule update\"\nbehaviour can be included by adding them to the list of allowable values\nfor the submodule.<name>.update variable.\n\nSigned-off-by: Johan Herland <johan@herland.net>\n---\n Documentation/git-submodule.txt |    4 ++--\n Documentation/gitmodules.txt    |   10 ++++++++--\n git-submodule.sh                |   32 +++++++++++++++++---------------\n t/t7406-submodule-update.sh     |   16 ++++++++--------\n 4 files changed, 35 insertions(+), 27 deletions(-)\n\ndiff --git a/Documentation/git-submodule.txt b/Documentation/git-submodule.txt\nindex acd16ac..cd8e861 100644\n--- a/Documentation/git-submodule.txt\n+++ b/Documentation/git-submodule.txt\n@@ -116,7 +116,7 @@ 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 unless '--rebase' is\n-\tspecified or the key `submodule.$name.rebase` is set to `true`.\n+\tspecified or the key `submodule.$name.update` is set to\t`rebase`.\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@@ -186,7 +186,7 @@ OPTIONS\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+\tIf the key `submodule.$name.update` is set to `rebase`, this option is\n \timplicit.\n \n --reference <repository>::\ndiff --git a/Documentation/gitmodules.txt b/Documentation/gitmodules.txt\nindex 7c22c40..1b67f0a 100644\n--- a/Documentation/gitmodules.txt\n+++ b/Documentation/gitmodules.txt\n@@ -30,8 +30,14 @@ 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+submodule.<name>.update::\n+\tDefines what to do when the submodule is updated by the superproject.\n+\tIf 'checkout' (the default), the new commit specified in the\n+\tsuperproject will be checked out in the submodule on a detached HEAD.\n+\tIf 'rebase', the current branch of the submodule will be rebased onto\n+\tthe commit specified in the superproject.\n+\tThis config option is overridden if 'git submodule update' is given\n+\tthe '--rebase' option.\n \n \n EXAMPLES\ndiff --git a/git-submodule.sh b/git-submodule.sh\nindex bbca183..19a3a84 100755\n--- a/git-submodule.sh\n+++ b/git-submodule.sh\n@@ -18,7 +18,7 @@ quiet=\n reference=\n cached=\n nofetch=\n-rebase=\n+update=\n \n #\n # print stuff on stdout unless -q was specified\n@@ -311,10 +311,10 @@ 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+\t\tupd=\"$(git config -f .gitmodules submodule.\"$name\".update)\"\n+\t\ttest -z \"$upd\" ||\n+\t\tgit config submodule.\"$name\".update \"$upd\" ||\n+\t\tdie \"Failed to register update mode for submodule path '$path'\"\n \n \t\tsay \"Submodule '$name' ($url) registered for path '$path'\"\n \tdone\n@@ -345,7 +345,7 @@ cmd_update()\n \t\t\t;;\n \t\t-r|--rebase)\n \t\t\tshift\n-\t\t\trebase=true\n+\t\t\tupdate=\"rebase\"\n \t\t\t;;\n \t\t--reference)\n \t\t\tcase \"$2\" in '') usage ;; esac\n@@ -379,7 +379,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\tupdate_module=$(git config submodule.\"$name\".update)\n \t\tif test -z \"$url\"\n \t\tthen\n \t\t\t# Only mention uninitialized submodules when its\n@@ -400,9 +400,9 @@ 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\tif ! test -z \"$update\"\n \t\tthen\n-\t\t\trebase_module=true\n+\t\t\tupdate_module=$update\n \t\tfi\n \n \t\tif test \"$subsha1\" != \"$sha1\"\n@@ -420,16 +420,18 @@ cmd_update()\n \t\t\t\tdie \"Unable to fetch in submodule path '$path'\"\n \t\t\tfi\n \n-\t\t\tif test true = \"$rebase_module\"\n-\t\t\tthen\n-\t\t\t\tcommand=\"git-rebase\"\n+\t\t\tcase \"$update_module\" in\n+\t\t\trebase)\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\t;;\n+\t\t\t*)\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+\t\t\t\t;;\n+\t\t\tesac\n \n \t\t\t(unset GIT_DIR; cd \"$path\" && $command \"$sha1\") ||\n \t\t\tdie \"Unable to $action '$sha1' in submodule path '$path'\"\ndiff --git a/t/t7406-submodule-update.sh b/t/t7406-submodule-update.sh\nindex 3442c05..0773fe4 100755\n--- a/t/t7406-submodule-update.sh\n+++ b/t/t7406-submodule-update.sh\n@@ -76,9 +76,9 @@ test_expect_success 'submodule update --rebase staying on master' '\n \t)\n '\n \n-test_expect_success 'submodule update - rebase true in .git/config' '\n+test_expect_success 'submodule update - rebase in .git/config' '\n \t(cd super &&\n-\t git config submodule.submodule.rebase true\n+\t git config submodule.submodule.update rebase\n \t) &&\n \t(cd super/submodule &&\n \t  git reset --hard HEAD~1\n@@ -93,9 +93,9 @@ test_expect_success 'submodule update - rebase true in .git/config' '\n \t)\n '\n \n-test_expect_success 'submodule update - rebase false in .git/config but --rebase given' '\n+test_expect_success 'submodule update - checkout in .git/config but --rebase given' '\n \t(cd super &&\n-\t git config submodule.submodule.rebase false\n+\t git config submodule.submodule.update checkout\n \t) &&\n \t(cd super/submodule &&\n \t  git reset --hard HEAD~1\n@@ -110,9 +110,9 @@ test_expect_success 'submodule update - rebase false in .git/config but --rebase\n \t)\n '\n \n-test_expect_success 'submodule update - rebase false in .git/config' '\n+test_expect_success 'submodule update - checkout in .git/config' '\n \t(cd super &&\n-\t git config submodule.submodule.rebase false\n+\t git config submodule.submodule.update checkout\n \t) &&\n \t(cd super/submodule &&\n \t  git reset --hard HEAD^\n@@ -131,9 +131,9 @@ 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 config submodule.rebasing.update rebase &&\n \t git submodule init rebasing &&\n-\t test true = $(git config --bool submodule.rebasing.rebase)\n+\t test \"rebase\" = $(git config submodule.rebasing.update)\n \t)\n '\n \n-- \n1.6.3.rc0.1.gf800\n"},{"id":"115319","messageId":"200906030846.35704.johan@herland.net","threadId":"19623","inReplyTo":"7v4ouydp0q.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH 1/2] Rename submodule.<name>.rebase to submodule.<name>.update","fromName":"Johan Herland","fromEmail":"johan@herland.net","sentAt":"2009-06-03T06:46:35Z","receivedAt":"2009-06-03T06:46:35Z","isPatch":true,"sender":{"key":"johan@herland.net","avatar":"https://avatars.githubusercontent.com/u/547031?v=4"},"body":"On Wednesday 03 June 2009, Junio C Hamano wrote:\n> Peter Hutterer <peter.hutterer@who-t.net> writes:\n> > I noticed this patch still leaves the --rebase commandline flag.\n> > Shouldn't that be changed to --update=rebase for consistency?\n>\n> If we were to add many more (I think --update=merge was mentioned, but do\n> we have any other plausibly useful modes of operations?) options, it\n> would make sense to support --update=rebase; my impression from the\n> previous discussion was that rebase would make sense for more people than\n> other modes would, so it also would make sense to keep --rebase as a\n> shorthand, rather than forcing everybody to say --update=rebase for the\n> sake of consistency.\n\nI agree. Even if we had a hundred alternatives, the most common should be \navailable in shorthand form.\n\nAlso, I don't think it makes sense to introduce --update=foo until we have, \nsay, 3-4 different alternatives. As long as --rebase and --merge are the \nonly alternatives (no other alternatives have been suggested so far, AFAIK), \nI don't think we need to introduce --update=foo.\n\n\nHave fun! :)\n\n...Johan\n\n-- \nJohan Herland, <johan@herland.net>\nwww.herland.net\n"}]}