All of lore.kernel.org
 help / color / mirror / Atom feed
* What's cooking in git.git (Feb 2013, #03; Wed, 6)
@ 2013-02-06 18:29 Junio C Hamano
  2013-02-06 19:25 ` Jens Lehmann
  0 siblings, 1 reply; 3+ messages in thread
From: Junio C Hamano @ 2013-02-06 18:29 UTC (permalink / raw)
  To: git

Here are the topics that have been cooking.  Commits prefixed with
'-' are only in 'pu' (proposed updates) while commits prefixed with
'+' are in 'next'.

As usual, this cycle is expected to last for 8 to 10 weeks, with a
preview -rc0 sometime in the middle of this month.

You can find the changes described here in the integration branches of the
repositories listed at

    http://git-blame.blogspot.com/p/git-public-repositories.html

--------------------------------------------------
[Graduated to "master"]

* ft/transport-report-segv (2013-01-31) 1 commit
  (merged to 'next' on 2013-02-02 at 6c450a7)
 + push: fix segfault when HEAD points nowhere

 A failure to push due to non-ff while on an unborn branch
 dereferenced a NULL pointer when showing an error message.


* jc/fake-ancestor-with-non-blobs (2013-01-31) 3 commits
  (merged to 'next' on 2013-02-02 at 86d457a)
 + apply: diagnose incomplete submodule object name better
 + apply: simplify build_fake_ancestor()
 + git-am: record full index line in the patch used while rebasing
 (this branch is used by jc/extended-fake-ancestor-for-gitlink.)

 Rebasing the history of superproject with change in the submodule
 has been broken since v1.7.12.


* jn/auto-depend-workaround-buggy-ccache (2013-02-01) 1 commit
  (merged to 'next' on 2013-02-02 at db5940a)
 + Makefile: explicitly set target name for autogenerated dependencies

 An age-old workaround to prevent buggy versions of ccache from
 breaking the auto-generation of dependencies, which unfortunately
 is still relevant because some people use ancient distros.


* sb/gpg-plug-fd-leak (2013-01-31) 1 commit
  (merged to 'next' on 2013-02-02 at c271a31)
 + gpg: close stderr once finished with it in verify_signed_buffer()

 We forgot to close the file descriptor reading from "gpg" output,
 killing "git log --show-signature" on a long history.


* ta/doc-no-small-caps (2013-02-01) 6 commits
  (merged to 'next' on 2013-02-02 at 77cbd0e)
 + Documentation: StGit is the right spelling, not StGIT
 + Documentation: describe the "repository" in repository-layout
 + Documentation: add a description for 'gitfile' to glossary
 + Documentation: do not use undefined terms git-dir and git-file
 + Documentation: the name of the system is 'Git', not 'git'
 + Documentation: avoid poor-man's small caps GIT

 Update documentation to change "GIT" which was a poor-man's small
 caps to "Git".  The latter was the intended spelling.

 Also change "git" spelled in all-lowercase to "Git" when it refers
 to the system as the whole or the concept it embodies, as opposed to
 the command the end users would type.

--------------------------------------------------
[New Topics]

* jc/extended-fake-ancestor-for-gitlink (2013-02-05) 1 commit
 - apply: verify submodule commit object name better

 Instead of requiring the full 40-hex object names on the index
 line, we can read submodule commit object names from the textual
 diff when synthesizing a fake ancestore tree for "git am -3".

 Will merge to 'next'.


* tz/credential-authinfo (2013-02-05) 1 commit
 - Add contrib/credentials/netrc with GPG support

 A new read-only credential helper (in contrib/) to interact with
 the .netrc/.authinfo files.  Hopefully mn/send-email-authinfo topic
 can rebuild on top of something like this.

 Waiting for further reviews.


* jx/utf8-printf-width (2013-02-05) 1 commit
 - Add utf8_fprintf helper which returns correct columns

 Use a new helper that prints a message and counts its display width
 to align the help messages parse-options produces.

--------------------------------------------------
[Stalled]

* mn/send-email-authinfo (2013-01-29) 1 commit
 - git-send-email: add ~/.authinfo parsing

 This triggered a subtopic to add a credential helper for
 authinfo/netrc files (with or without GPG encryption), but nobody
 seems to be working on connecting send-email to the credential
 framework.


* mp/diff-algo-config (2013-01-16) 3 commits
 - diff: Introduce --diff-algorithm command line option
 - config: Introduce diff.algorithm variable
 - git-completion.bash: Autocomplete --minimal and --histogram for git-diff

 Add diff.algorithm configuration so that the user does not type
 "diff --histogram".

 Looking better; may want tests to protect it from future breakages,
 but otherwise it looks ready for 'next'.

 Expecting a follow-up to add tests.


* mb/gitweb-highlight-link-target (2012-12-20) 1 commit
 - Highlight the link target line in Gitweb using CSS

 Expecting a reroll.
 $gmane/211935


* jk/lua-hackery (2012-10-07) 6 commits
 - pretty: fix up one-off format_commit_message calls
 - Minimum compilation fixup
 - Makefile: make "lua" a bit more configurable
 - add a "lua" pretty format
 - add basic lua infrastructure
 - pretty: make some commit-parsing helpers more public

 Interesting exercise. When we do this for real, we probably would want
 to wrap a commit to make it more like an "object" with methods like
 "parents", etc.


* rc/maint-complete-git-p4 (2012-09-24) 1 commit
 - Teach git-completion about git p4

 Comment from Pete will need to be addressed ($gmane/206172).


* jc/maint-name-rev (2012-09-17) 7 commits
 - describe --contains: use "name-rev --algorithm=weight"
 - name-rev --algorithm=weight: tests and documentation
 - name-rev --algorithm=weight: cache the computed weight in notes
 - name-rev --algorithm=weight: trivial optimization
 - name-rev: --algorithm option
 - name_rev: clarify the logic to assign a new tip-name to a commit
 - name-rev: lose unnecessary typedef

 "git name-rev" names the given revision based on a ref that can be
 reached in the smallest number of steps from the rev, but that is
 not useful when the caller wants to know which tag is the oldest one
 that contains the rev.  This teaches a new mode to the command that
 uses the oldest ref among those which contain the rev.

 I am not sure if this is worth it; for one thing, even with the help
 from notes-cache, it seems to make the "describe --contains" even
 slower. Also the command will be unusably slow for a user who does
 not have a write access (hence unable to create or update the
 notes-cache).

 Stalled mostly due to lack of responses.


* jc/xprm-generation (2012-09-14) 1 commit
 - test-generation: compute generation numbers and clock skews

 A toy to analyze how bad the clock skews are in histories of real
 world projects.

 Stalled mostly due to lack of responses.


* jc/add-delete-default (2012-08-13) 1 commit
 - git add: notice removal of tracked paths by default

 "git add dir/" updated modified files and added new files, but does
 not notice removed files, which may be "Huh?" to some users.  They
 can of course use "git add -A dir/", but why should they?

 Resurrected from graveyard, as I thought it was a worthwhile thing
 to do in the longer term.

 Stalled mostly due to lack of responses.


* mb/remote-default-nn-origin (2012-07-11) 6 commits
 - Teach get_default_remote to respect remote.default.
 - Test that plain "git fetch" uses remote.default when on a detached HEAD.
 - Teach clone to set remote.default.
 - Teach "git remote" about remote.default.
 - Teach remote.c about the remote.default configuration setting.
 - Rename remote.c's default_remote_name static variables.

 When the user does not specify what remote to interact with, we
 often attempt to use 'origin'.  This can now be customized via a
 configuration variable.

 Expecting a reroll.
 $gmane/210151

 "The first remote becomes the default" bit is better done as a
 separate step.


* nd/parse-pathspec (2013-01-11) 20 commits
 . Convert more init_pathspec() to parse_pathspec()
 . Convert add_files_to_cache to take struct pathspec
 . Convert {read,fill}_directory to take struct pathspec
 . Convert refresh_index to take struct pathspec
 . Convert report_path_error to take struct pathspec
 . checkout: convert read_tree_some to take struct pathspec
 . Convert unmerge_cache to take struct pathspec
 . Convert read_cache_preload() to take struct pathspec
 . add: convert to use parse_pathspec
 . archive: convert to use parse_pathspec
 . ls-files: convert to use parse_pathspec
 . rm: convert to use parse_pathspec
 . checkout: convert to use parse_pathspec
 . rerere: convert to use parse_pathspec
 . status: convert to use parse_pathspec
 . commit: convert to use parse_pathspec
 . clean: convert to use parse_pathspec
 . Export parse_pathspec() and convert some get_pathspec() calls
 . Add parse_pathspec() that converts cmdline args to struct pathspec
 . pathspec: save the non-wildcard length part

 Uses the parsed pathspec structure in more places where we used to
 use the raw "array of strings" pathspec.

 Ejected from 'pu' for now; will take a look at the rerolled one
 later ($gmane/213340).

--------------------------------------------------
[Cooking]

* dg/subtree-fixes (2013-02-05) 6 commits
 - contrib/subtree: make the manual directory if needed
 - contrib/subtree: honor DESTDIR
 - contrib/subtree: fix synopsis
 - contrib/subtree: better error handling for 'subtree add'
 - contrib/subtree: use %B for split subject/body
 - contrib/subtree: remove test number comments

 contrib/subtree updates, but here are only the ones that looked
 ready to be merged to 'next'.  For the remainder, they will have
 another day.

 Will merge to 'next'.


* jl/submodule-deinit (2013-02-04) 1 commit
 - submodule: add 'deinit' command

 There was no Porcelain way to say "I no longer am interested in
 this submodule", once you express your interest in a submodule with
 "submodule init".  "submodule deinit" is the way to do so.

 Will merge to 'next'.


* ct/autoconf-htmldir (2013-02-02) 1 commit
  (merged to 'next' on 2013-02-05 at bba4f8c)
 + Honor configure's htmldir switch

 The autoconf subsystem passed --mandir down to generated
 config.mak.autogen but forgot to do the same for --htmldir.

 Will merge to 'master'.


* mk/tcsh-complete-only-known-paths (2013-02-03) 1 commit
  (merged to 'next' on 2013-02-05 at 4409b08)
 + completion: handle path completion and colon for tcsh script
 (this branch uses mp/complete-paths.)

 Manlio's "complete with known paths only" update to completion
 scripts returns directory names without trailing slash to
 compensate the addition of '/' done by bash that reads from our
 completion result.  tcsh completion code that reads from our
 internal completion result does not add '/', so let it ask our
 complletion code to keep the '/' at the end.

 Will merge to 'master'.


* jc/combine-diff-many-parents (2013-02-05) 2 commits
  (merged to 'next' on 2013-02-05 at e382aa6)
 + t4038: add tests for "diff --cc --raw <trees>"
 + combine-diff: lift 32-way limit of combined diff

 We used to have an arbitrary 32 limit for combined diff input,
 resulting in incorrect number of leading colons shown when showing
 the "--raw --cc" output.

 Will merge to 'master'.


* jc/remove-export-from-config-mak-in (2013-02-03) 1 commit
 - config.mak.in: remove unused definitions

 config.mak.in template had an "export" line to cause a few
 common makefile variables to be exported; if they need to be
 expoted for autoconf/configure users, they should also be exported
 for people who write config.mak the same way.  Move the "export" to
 the main Makefile.


* jk/apply-similaritly-parsing (2013-02-03) 1 commit
  (merged to 'next' on 2013-02-05 at ccf1c97)
 + builtin/apply: tighten (dis)similarity index parsing

 Make sure the similarity value shown in the "apply --summary"
 output is sensible, even when the input had a bogus value.

 Will merge to 'master'.


* nd/status-show-in-progress (2013-02-05) 1 commit
 - status: show the branch name if possible in in-progress info

 Will merge to 'next'.


* sb/gpg-i18n (2013-01-31) 1 commit
  (merged to 'next' on 2013-02-02 at 7a54574)
 + gpg: allow translation of more error messages

 Will merge to 'master'.


* sb/run-command-fd-error-reporting (2013-02-01) 1 commit
  (merged to 'next' on 2013-02-02 at be7e970)
 + run-command: be more informative about what failed

 Will merge to 'master'.


* jk/remote-helpers-doc (2013-02-01) 1 commit
  (merged to 'next' on 2013-02-02 at ce1461a)
 + Rename {git- => git}remote-helpers.txt

 "git help remote-helpers" did not work; 'remote-helpers' is not
 a subcommand name but a concept, so its documentation should have
 been in gitremote-helpers, not git-remote-helpers.

 Will merge to 'master'.


* sp/smart-http-content-type-check (2013-02-06) 3 commits
  (merged to 'next' on 2013-02-06 at 8bc6434)
 + http_request: reset "type" strbuf before adding
  (merged to 'next' on 2013-02-05 at 157812c)
 + t5551: fix expected error output
  (merged to 'next' on 2013-02-04 at d0759cb)
 + Verify Content-Type from smart HTTP servers

 The smart HTTP clients forgot to verify the content-type that comes
 back from the server side to make sure that the request is being
 handled properly.


* jc/mention-tracking-for-pull-default (2013-01-31) 1 commit
 - doc: mention tracking for pull.default

 We stopped mentioning `tracking` is a deprecated but supported
 synonym for `upstream` in pull.default even though we have no
 intention of removing the support for it.

 This is my "don't list it to catch readers' eyes, but make sure it
 can be found if the reader looks for it" version; I'm not married
 to the layout and will be happy to take a replacement patch.

 Waiting for couter-proposal patches.


* jk/doc-makefile-cleanup (2013-02-01) 1 commit
  (merged to 'next' on 2013-02-02 at 86ff373)
 + Documentation/Makefile: clean up MAN*_TXT lists

 Will merge to 'master'.


* ab/gitweb-use-same-scheme (2013-01-28) 1 commit
  (merged to 'next' on 2013-02-02 at 7e4a108)
 + gitweb: refer to picon/gravatar images over the same scheme

 Avoid mixed contents on a page coming via http and https when
 gitweb is hosted on a https server.

 Will merge to 'master'.


* jk/python-styles (2013-01-30) 1 commit
  (merged to 'next' on 2013-02-02 at 293edc1)
 + CodingGuidelines: add Python coding guidelines

 Will merge to 'master'.


* mp/complete-paths (2013-01-11) 1 commit
  (merged to 'next' on 2013-01-30 at 70e4f1a)
 + git-completion.bash: add support for path completion
 (this branch is used by mk/tcsh-complete-only-known-paths.)

 The completion script used to let the default completer to suggest
 pathnames, which gave too many irrelevant choices (e.g. "git add"
 would not want to add an unmodified path).  Teach it to use a more
 git-aware logic to enumerate only relevant ones.

 This is logically the right thing to do, and we would really love
 to see people who have been involved in completion code to review
 and comment on the implementation.

 Will cook in 'next' to see if anybody screams.


* ss/mergetools-tortoise (2013-02-01) 2 commits
  (merged to 'next' on 2013-02-03 at d306b83)
 + mergetools: teach tortoisemerge to handle filenames with SP correctly
 + mergetools: support TortoiseGitMerge

 Update mergetools to work better with newer merge helper tortoise ships.

 Will merge to 'master'.


* da/mergetool-docs (2013-02-02) 5 commits
  (merged to 'next' on 2013-02-03 at f822dcf)
 + doc: generate a list of valid merge tools
 + mergetool--lib: list user configured tools in '--tool-help'
 + mergetool--lib: add functions for finding available tools
 + mergetool--lib: improve the help text in guess_merge_tool()
 + mergetool--lib: simplify command expressions
 (this branch uses jk/mergetool.)

 Build on top of the clean-up done by jk/mergetool and automatically
 generate the list of mergetool and difftool backends the build
 supports to be included in the documentation.

 Will merge to 'master'.


* nd/branch-error-cases (2013-01-31) 6 commits
  (merged to 'next' on 2013-02-02 at cf5e745)
 + branch: let branch filters imply --list
 + docs: clarify git-branch --list behavior
 + branch: mark more strings for translation
 + Merge branch 'nd/edit-branch-desc-while-detached' into HEAD
 + branch: give a more helpful message on redundant arguments
 + branch: reject -D/-d without branch name

 Fix various error messages and conditions in "git branch", e.g. we
 advertised "branch -d/-D" to remove one or more branches but actually
 implemented removal of zero or more branches---request to remove no
 branches was not rejected.

 Will merge to 'master'.


* jk/mergetool (2013-01-28) 8 commits
  (merged to 'next' on 2013-02-03 at 2ff5dee)
 + mergetools: simplify how we handle "vim" and "defaults"
 + mergetool--lib: don't call "exit" in setup_tool
 + mergetool--lib: improve show_tool_help() output
 + mergetools/vim: remove redundant diff command
 + git-difftool: use git-mergetool--lib for "--tool-help"
 + git-mergetool: don't hardcode 'mergetool' in show_tool_help
 + git-mergetool: remove redundant assignment
 + git-mergetool: move show_tool_help to mergetool--lib
 (this branch is used by da/mergetool-docs.)

 Cleans up mergetool/difftool combo.

 Will merge to 'master'.


* jc/hidden-refs (2013-01-30) 7 commits
 - fetch: fetch objects by their exact SHA-1 object names
 - upload-pack: optionally allow fetching from the tips of hidden refs
 - fetch: use struct ref to represent refs to be fetched
 - parse_fetch_refspec(): clarify the codeflow a bit
 - upload/receive-pack: allow hiding ref hierarchies
 - upload-pack: simplify request validation
 - upload-pack: share more code

 Allow the server side to unclutter the refs/ namespace it shows to
 the client.  Optionally allow requests for histories leading to the
 tips of hidden refs by updated clients.

 Need to split the configuration into three (one for sending, one
 for receiving, and then another to cover both for convenience)
 before this topic can go forward. Perhaps people involved in the
 review cycle can help.


* jc/remove-treesame-parent-in-simplify-merges (2013-01-17) 1 commit
  (merged to 'next' on 2013-01-30 at b639b47)
 + simplify-merges: drop merge from irrelevant side branch

 The --simplify-merges logic did not cull irrelevant parents from a
 merge that is otherwise not interesting with respect to the paths
 we are following.

 This touches a fairly core part of the revision traversal
 infrastructure; even though I think this change is correct, please
 report immediately if you find any unintended side effect.

 Will cook in 'next'.


* jc/push-2.0-default-to-simple (2013-01-16) 14 commits
  (merged to 'next' on 2013-01-16 at 23f5df2)
 + t5570: do not assume the "matching" push is the default
 + t5551: do not assume the "matching" push is the default
 + t5550: do not assume the "matching" push is the default
  (merged to 'next' on 2013-01-09 at 74c3498)
 + doc: push.default is no longer "matching"
 + push: switch default from "matching" to "simple"
 + t9401: do not assume the "matching" push is the default
 + t9400: do not assume the "matching" push is the default
 + t7406: do not assume the "matching" push is the default
 + t5531: do not assume the "matching" push is the default
 + t5519: do not assume the "matching" push is the default
 + t5517: do not assume the "matching" push is the default
 + t5516: do not assume the "matching" push is the default
 + t5505: do not assume the "matching" push is the default
 + t5404: do not assume the "matching" push is the default

 Will cook in 'next' until Git 2.0 ;-).


* bc/append-signed-off-by (2013-01-27) 11 commits
 - Unify appending signoff in format-patch, commit and sequencer
 - format-patch: update append_signoff prototype
 - t4014: more tests about appending s-o-b lines
 - sequencer.c: teach append_signoff to avoid adding a duplicate newline
 - sequencer.c: teach append_signoff how to detect duplicate s-o-b
 - sequencer.c: always separate "(cherry picked from" from commit body
 - sequencer.c: recognize "(cherry picked from ..." as part of s-o-b footer
 - t/t3511: add some tests of 'cherry-pick -s' functionality
 - t/test-lib-functions.sh: allow to specify the tag name to test_commit
 - commit, cherry-pick -s: remove broken support for multiline rfc2822 fields
 - sequencer.c: rework search for start of footer to improve clarity

 Waiting for the final round of reroll before merging to 'next'.
 After that we will go incremental.

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

* Re: What's cooking in git.git (Feb 2013, #03; Wed, 6)
  2013-02-06 18:29 What's cooking in git.git (Feb 2013, #03; Wed, 6) Junio C Hamano
@ 2013-02-06 19:25 ` Jens Lehmann
  2013-02-06 19:39   ` Junio C Hamano
  0 siblings, 1 reply; 3+ messages in thread
From: Jens Lehmann @ 2013-02-06 19:25 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

Am 06.02.2013 19:29, schrieb Junio C Hamano:
> * jl/submodule-deinit (2013-02-04) 1 commit
>  - submodule: add 'deinit' command
> 
>  There was no Porcelain way to say "I no longer am interested in
>  this submodule", once you express your interest in a submodule with
>  "submodule init".  "submodule deinit" is the way to do so.
> 
>  Will merge to 'next'.

Oops, I though you were waiting for a reroll. Currently I'm having the
appended interdiff compared to your version. Changes are:

- Add deinit to the --force documentation of "git submodule"
- Never remove submodules containing a .git dir, even when forced
- diagnostic output when "rm -rf" or "mkdir" fails
- More test cases

And I wanted to add three more test cases for modified submodules before
sending v4. You could squash in the first two hunks into the commit you
have in pu and I'll send a follow up patch with the extra tests soon or
you could wait for me sending an updated patch. What do you think?

---------------8<------------------
diff --git a/Documentation/git-submodule.txt b/Documentation/git-submodule.txt
index 7a149eb..45ee12b 100644
--- a/Documentation/git-submodule.txt
+++ b/Documentation/git-submodule.txt
@@ -227,8 +227,10 @@ OPTIONS

 -f::
 --force::
-	This option is only valid for add and update commands.
+	This option is only valid for add, deinit and update commands.
 	When running add, allow adding an otherwise ignored submodule path.
+	When running deinit the submodule work trees will be removed even if
+	they contain local changes.
 	When running update, throw away local changes in submodules when
 	switching to a different commit; and always run a checkout operation
 	in the submodule, even if the commit listed in the index of the
diff --git a/git-submodule.sh b/git-submodule.sh
index f05b597..365c6de 100755
--- a/git-submodule.sh
+++ b/git-submodule.sh
@@ -595,14 +595,25 @@ cmd_deinit()
 			continue
 		fi

-		# Remove the submodule work tree
-		if test -z "$force"
+		# Remove the submodule work tree (unless the user already did it)
+		if test -d "$sm_path"
 		then
-			git rm -n "$sm_path" ||
-			die "$(eval_gettext "Submodule work tree $sm_path contains local modifications, use '-f' to discard them")"
+			# Protect submodules containing a .git directory
+			if test -d "$sm_path/.git"
+			then
+				echo >&2 "$(eval_gettext "Submodule work tree $sm_path contains a .git directory")"
+				die "$(eval_gettext "(use 'rm -rf' if you really want to remove it including all of its history)")"
+			fi
+
+			if test -z "$force"
+			then
+				git rm -n "$sm_path" ||
+				die "$(eval_gettext "Submodule work tree $sm_path contains local modifications, use '-f' to discard them")"
+			fi
+			rm -rf "$sm_path" || say "$(eval_gettext "Could not remove submodule work tree '\$sm_path'")"
 		fi
-		rm -rf "$sm_path"
-		mkdir "$sm_path"
+
+		mkdir "$sm_path" || say "$(eval_gettext "Could not create empty submodule directory '\$sm_path'")"

 		# Remove the whole section so we have a clean state when the
 		# user later decides to init this submodule again
diff --git a/t/t7400-submodule-basic.sh b/t/t7400-submodule-basic.sh
index 34d8274..0567f1a 100755
--- a/t/t7400-submodule-basic.sh
+++ b/t/t7400-submodule-basic.sh
@@ -757,20 +757,46 @@ test_expect_success 'submodule add with an existing name fails unless forced' '
 	)
 '

+test_expect_success 'set up a second submodule' '
+	git submodule add ./init2 example2 &&
+	git commit -m "submodle example2 added"
+'
+
 test_expect_success 'submodule deinit should remove the whole submodule section from .git/config' '
 	git config submodule.example.foo bar &&
+	git config submodule.example2.frotz nitfol &&
 	git submodule deinit init &&
 	test -z "$(git config submodule.example.url)" &&
-	test -z "$(git config submodule.example.foo)"
+	test -z "$(git config submodule.example.foo)" &&
+	test -n "$(git config submodule.example2.url)" &&
+	test -n "$(git config submodule.example2.frotz)" &&
+	rmdir init
 '

 test_expect_success 'submodule deinit . deinits all initialized submodules' '
 	git submodule update --init &&
 	git config submodule.example.foo bar &&
+	git config submodule.example2.frotz nitfol &&
 	test_must_fail git submodule deinit &&
 	git submodule deinit . &&
 	test -z "$(git config submodule.example.url)" &&
-	test -z "$(git config submodule.example.foo)"
+	test -z "$(git config submodule.example.foo)" &&
+	test -z "$(git config submodule.example2.url)" &&
+	test -z "$(git config submodule.example2.frotz)" &&
+	rmdir init example2
+'
+
+test_expect_success 'submodule deinit deinits a submodule when its work tree is missing or empty' '
+	git submodule update --init &&
+	rm -rf init example2/* example2/.git &&
+	git config submodule.example.foo bar &&
+	git config submodule.example2.frotz nitfol &&
+	git submodule deinit init example2 &&
+	test -z "$(git config submodule.example.url)" &&
+	test -z "$(git config submodule.example.foo)" &&
+	test -z "$(git config submodule.example2.url)" &&
+	test -z "$(git config submodule.example2.frotz)" &&
+	rmdir init
 '

 test_expect_success 'submodule deinit complains when explicitly used on an uninitialized submodule' '
@@ -778,7 +804,24 @@ test_expect_success 'submodule deinit complains when explicitly used on an unini
 	git submodule deinit init >actual &&
 	test_i18ngrep "Submodule .example. (.*) unregistered for path .init" actual
 	git submodule deinit init >actual &&
-	test_i18ngrep "No url found for submodule path .init. in .git/config" actual
+	test_i18ngrep "No url found for submodule path .init. in .git/config" actual &&
+	git submodule deinit . >actual &&
+	test_i18ngrep "Submodule .example2. (.*) unregistered for path .example2" actual
+	rmdir init example2
+'
+
+test_expect_success 'submodule deinit fails when submodule has a .git directory even when forced' '
+	git submodule update --init &&
+	(
+		cd init &&
+		rm .git &&
+		cp -R ../.git/modules/example .git &&
+		GIT_WORK_TREE=. git config --unset core.worktree
+	) &&
+	test_must_fail git submodule deinit init &&
+	test_must_fail git submodule deinit -f init &&
+	test -d init/.git &&
+	test -n "$(git config submodule.example.url)"
 '

 test_done

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

* Re: What's cooking in git.git (Feb 2013, #03; Wed, 6)
  2013-02-06 19:25 ` Jens Lehmann
@ 2013-02-06 19:39   ` Junio C Hamano
  0 siblings, 0 replies; 3+ messages in thread
From: Junio C Hamano @ 2013-02-06 19:39 UTC (permalink / raw)
  To: Jens Lehmann; +Cc: git

Jens Lehmann <Jens.Lehmann@web.de> writes:

> Am 06.02.2013 19:29, schrieb Junio C Hamano:
>> * jl/submodule-deinit (2013-02-04) 1 commit
>>  - submodule: add 'deinit' command
>> 
>>  There was no Porcelain way to say "I no longer am interested in
>>  this submodule", once you express your interest in a submodule with
>>  "submodule init".  "submodule deinit" is the way to do so.
>> 
>>  Will merge to 'next'.
>
> Oops, I though you were waiting for a reroll. Currently I'm having the
> appended interdiff compared to your version. Changes are:
>
> - Add deinit to the --force documentation of "git submodule"
> - Never remove submodules containing a .git dir, even when forced
> - diagnostic output when "rm -rf" or "mkdir" fails
> - More test cases
>
> And I wanted to add three more test cases for modified submodules before
> sending v4. You could squash in the first two hunks into the commit you
> have in pu and I'll send a follow up patch with the extra tests soon or
> you could wait for me sending an updated patch. What do you think?

I haven't merged it down to 'next' yet.  So please proceed as you
planned.  Thanks for stopping me.

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

end of thread, other threads:[~2013-02-06 19:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-06 18:29 What's cooking in git.git (Feb 2013, #03; Wed, 6) Junio C Hamano
2013-02-06 19:25 ` Jens Lehmann
2013-02-06 19:39   ` Junio C Hamano

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.