submodule: add 'deinit' command

With "git submodule init" the user is able to tell git he cares about one
or more submodules and wants to have it populated on the next call to "git
submodule update". But currently there is no easy way he could tell git he
does not care about a submodule anymore and wants to get rid of his local
work tree (except he knows a lot about submodule internals and removes the
"submodule.$name.url" setting from .git/config together with the work tree
himself).

Help those users by providing a 'deinit' command. This removes the
whole submodule.<name> section from .git/config (either for the given
submodule(s) or for all those which have been initialized if '.' is used)
together with their work tree. Fail if the current work tree contains
modifications (unless forced), but don't complain when either the work
tree is already removed or no settings are found in .git/config.

Add tests and link the man pages of "git submodule deinit" and "git rm"
to assist the user in deciding whether removing or unregistering the
submodule is the right thing to do for him. Also add the deinit subcommand
to the completion list.

Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
match_push_refs(): nobody sets src->peer_ref anymore

In ancient times, we used to disallow the same source ref to be
pushed to more than one places, e.g. "git push there master:master
master:naster" was disallowed.  We later lifted this restriction
with db27ee63929f (send-pack: allow the same source to be pushed
more than once., 2005-08-06) and there no longer is anybody that
sets peer_ref for the source side of the ref list in the push
codepath since then.

Remove one leftover no-op in a loop that iterates over the source
side of ref list (i.e. our local ref) to see if it can/should be
sent to a matching destination ref while skipping ones that is
marked with peer_ref (which will never exist, so we do not skip
anything).

Signed-off-by: Junio C Hamano <gitster@pobox.com>
commit: add in_merge_bases_many()

Similar to in_merge_bases(commit, other) that returns true when
commit is an ancestor (i.e. in the merge bases between the two) of
the other commit, in_merge_bases_many(commit, n_other, other[])
checks if commit is an ancestor of any of the other[] commits.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
push: --follow-tag

The new option "--follow-tag" tells "git push" to push tags that are
missing from the other side and that can be reached by the history
that is otherwise pushed out.  For example, if you are using the
"simple", "current", or "upstream" push, you would ordinarily push
the history leading to the commit at your current HEAD and nothing
else.  With this option, you would also push all tags that can be
reached from that commit to the other side.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
Merge branch 'jl/submodule-deinit' into jch

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.

Expecting a reroll.
$gmane/216498

* jl/submodule-deinit:
  submodule: add 'deinit' command

Conflicts:
	Documentation/git-submodule.txt
	git-submodule.sh
Merge branch 'jk/suppress-clang-warning' into jch

* jk/suppress-clang-warning:
  fix clang -Wtautological-compare with unsigned enum
Merge branch 'jc/format-patch' into jch

A new option to send a single patch to the standard output to be
appended at the bottom of a message.  I personally have no need for
this, but it was easy enough to cobble together.  Tests, docs and
stripping out more MIMEy stuff are left as exercises to interested
parties.

Not ready for inclusion.

* jc/format-patch:
  format-patch: --inline-single
  format-patch: rename "no_inline" field
Merge branch 'jc/add-delete-default' into jch

"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.

There seems to be some interest. Let's see if it results in a solid
execution of a sensible transition plan towards Git 2.0.

* jc/add-delete-default:
  git add: notice removal of tracked paths by default
Merge branch 'jk/common-make-variables-export-safety' into jch

Make the three variables safer to be exported to submakes by
ensuring that they are full paths so that they can be used as
installation location.

Will merge to and cook in 'next'.

* jk/common-make-variables-export-safety:
  Makefile: make mandir, htmldir and infodir absolute
Merge branch 'kb/name-hash' into jch

The code to keep track of what directory names are known to Git on
platforms with case insensitive filesystems can get confused upon
a hash collision between these pathnames and looped forever.

Will merge to and cook in 'next'.

* kb/name-hash:
  name-hash.c: fix endless loop with core.ignorecase=true
Merge branch 'jc/describe' into jch

We may want to have a looser matching that does not restrict to tags,
but that can be done as a follow-up topic; this step is purely a bugfix.

Will merge to and cook in 'next'.

* jc/describe:
  describe: --match=<pattern> must limit the refs even when used with --all
Merge branch 'ap/maint-diff-rename-avoid-overlap' into jch

The logic used by "git diff -M --stat" to shorten the names of
files before and after a rename did not work correctly when the
common prefix and suffix between the two filenames overlapped.

Will cook in 'next' (the tip may still be rerolled).

* ap/maint-diff-rename-avoid-overlap:
  tests: make sure rename pretty print works
Merge branch 'jc/nobody-sets-src-peer-ref' into jch

* jc/nobody-sets-src-peer-ref:
  match_push_refs(): nobody sets src->peer_ref anymore
Merge branch 'jc/push-follow-tag' into jch

* jc/push-follow-tag:
  push: --follow-tag
  commit: add in_merge_bases_many()
Merge branch 'mg/qnx6' into pu

Still under discussion.
Not ready for inclusion.

* mg/qnx6:
  QNX: newer QNX 6.x.x is not so crippled
Merge branch 'jn/shell-disable-interactive' into pu

Expecting a reroll.
$gmane/216229

* jn/shell-disable-interactive:
  shell: pay attention to exit status from 'help' command
  shell doc: emphasize purpose and security model
Merge branch 'nd/branch-show-rebase-bisect-state' into pu

This is hopefully almost there.

Expecting a reroll.

* nd/branch-show-rebase-bisect-state:
  branch: show more information when HEAD is detached
  status: show the ref that is checked out, even if it's detached
  wt-status: move wt_status_get_state() out to wt_status_print()
  wt-status: split wt_status_state parsing function out
  checkout: record full target ref in reflog
Merge branch 'mb/gitweb-highlight-link-target' into pu

Expecting a reroll.
$gmane/211935

* mb/gitweb-highlight-link-target:
  Highlight the link target line in Gitweb using CSS
Merge branch 'mb/remote-default-nn-origin' into pu

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.

* mb/remote-default-nn-origin:
  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.

Conflicts:
	builtin/remote.c
	t/t5505-remote.sh
Merge branch 'mg/unsigned-time-t' into pu

A few workarounds for systems with unsigned time_t.

* mg/unsigned-time-t:
  Fix time offset calculation in case of unsigned time_t
  date.c: fix unsigned time_t comparison