Reduce cost of deletion in levenstein distance (4 -> 3)

Before this patch, a character deletion has the same cost as 2 swaps, or
4 additions, so Git prefers suggesting a completely scrambled command
name to removing a character. For example, "git tags" suggests "stage",
but not "tag".

By setting the deletion cost to 3, we keep it higher than swaps or
additions, but prefer 1 deletion to 2 swaps. "git tags" now suggests
"tag" in addition to staged.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Do not autosquash in case of an implied interactive rebase

The option to autosquash is only used in case of an interactive rebase.
When merges are preserved, rebase uses an interactive rebase internally,
but in this case autosquash should still be disabled.

Signed-off-by: Vincent van Ravesteijn <vfr@lyx.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
submodules: print "registered for path" message only once

Since 2cd9de3e (submodule add: always initialize .git/config entry) the
message "Submodule '\$name' (\$url) registered for path '\$sm_path'" is
printed every time cmd_init() is called, e.g. each time "git submodule
update" is used with the --init option.

This was not intended and leads to bogus output which can confuse users
and build systems. Apart from that the $url variable was not set after the
first run which did the actual initialization and only "()" was printed
in subsequent runs where "($url)" was meant to inform the user about the
upstream repo.

Fix that by moving the say command in question into the if block where the
url is initialized, restoring the behavior that was in place before the
2cd9de3e commit. While at it also remove the comment which still describes
the logic used before 2cd9de3e and add a comment about how things work now.

Reported-by: Nicolas Viennot and Sid Nair <nicolas@viennot.com>
Reported-by: Heiko Voigt <hvoigt@hvoigt.net>
Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
cherry-pick: regression fix for empty commits

The earlier "--keep-redundant-commit" series broke "cherry-pick"
that is given a commit whose change is already in the current
history. Such a cherry-pick would result in an empty change, and
should stop with an error, telling the user that conflict resolution
may have made the result empty (which is exactly what is happening),
but we silently dropped the change on the floor without any message
nor non-zero exit code.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
INSTALL: update asciidoc recommendation

Since commit 6cf378f (docs: stop using asciidoc no-inline-literal),
we no longer support asciidoc versions less than 8.4.1,
which introduced inline literals. Note this in the INSTALL
document.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
rebase: report invalid commit correctly

In 9765b6a (rebase: align variable content, 2011-02-06), the code
to error out was moved up one level. Unfortunately, one reference
to a function parameter wasn't rewritten as it should, leading to
the wrong parameter being errored on.

This error was propagated by 71786f5 (rebase: factor out reference
parsing, 2011-02-06) and merged in 78c6e0f (Merge branch
'mz/rebase', 2011-04-28).

Correct this by reporting $onto_name istead.

Reported-By: Manuela Hutter <manuelah@opera.com>
Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Merge branch 'master' into next

By Jeff King
* master:
  INSTALL: update asciidoc recommendation
Merge branch 'jl/submodule-report-new-path-once' into next

Will merge to master by 1.7.11 final.

By Jens Lehmann
* jl/submodule-report-new-path-once:
  submodules: print "registered for path" message only once
Merge branch 'mm/levenstein-penalize-deletion-less' into next

Will merge to master by 1.7.11 final.

By Matthieu Moy
* mm/levenstein-penalize-deletion-less:
  Reduce cost of deletion in levenstein distance (4 -> 3)
Merge branch 'vr/rebase-autosquash-does-not-imply-i' into next

Will merge to master by 1.7.11 final.

By Vincent van Ravesteijn
* vr/rebase-autosquash-does-not-imply-i:
  Do not autosquash in case of an implied interactive rebase
Merge branch 'nh/empty-rebase' into next

Will merge to master by 1.7.11 final.

* nh/empty-rebase:
  cherry-pick: regression fix for empty commits
Merge branch 'ef/maint-rebase-error-message' into next

Will merge to master by 1.7.11 final.

By Erik Faye-Lund
* ef/maint-rebase-error-message:
  rebase: report invalid commit correctly