rebase: Handle cases where format-patch fails

'format-patch' could fail due to reasons such as out of memory. Such
failures are not detected or handled, which causes rebase to incorrectly
think that it completed successfully and continue with cleanup. i.e.
calling move_to_original_branch

Instead of using a pipe, we separate 'format-patch' and 'am' by using an
intermediate file. This gurantees that we can invoke 'am' with the
complete input, or not invoking 'am' at all if 'format-patch' failed.

Also remove the use of '&&' at the end of the if-block, and rearrange
the 'write_basic_state' and 'move_to_original_branch' to make the logic
flow a bit better and easier to read.

Signed-off-by: Andrew Wong <andrew.kw.w@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
tests: move test_cmp_rev to test-lib-functions

A function for checking that two given parameters refer to the same
revision was defined in several places, so move the definition to
test-lib-functions.sh instead.

Signed-off-by: Martin von Zweigbergk <martinvonz@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
learn to pick/revert into unborn branch

cherry-picking into an unborn branch should work, so make it work,
with or without --ff.

Cherry-picking anything other than a commit that only adds files, will
naturally result in conflicts. Similarly, revert also works, but will
result in conflicts unless the specified revision only deletes files.

Signed-off-by: Martin von Zweigbergk <martinvonz@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Remove Documentation/pt_BR/gittutorial.txt

This file is rather outdated and IMHO shouldn't be there in the first place.
(If there are translations of the Git documentation they are better be kept
separate from the original documentation.)

Signed-off-by: Thomas Ackermann <th.acker@arcor.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Add checks to Python scripts for version dependencies.

Signed-off-by: Eric S. Raymond <esr@thyrsus.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Remove the suggestion to use parsecvs, which is currently broken.

The parsecvs code has been neglected for a long time, and the only
public version does not even build correctly.  I have been handed
control of the project and intend to fix this, but until I do it
cannot be recommended.

Also, the project URL given for Subversion needed to be updated
to follow their site move.

Signed-off-by: Eric S. Raymond <esr@thyrsus.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Use longer alias names in subdirectory tests

When testing aliases in t/t1020-subdirectory.sh use longer names so that
they're less likely to conflict with a git-* command somewhere in the
$PATH.

I have a git-ss command in my path which prevents the 'ss' alias from
being used.  This command will always fail for git.git, causing the test
to fail.  Even if the command succeeded, that would be a false success
for the test since the alias wasn't actually used.  A longer, more
descriptive name will make it much less likely that somebody has a
command in their $PATH which will shadow the alias created for the test.

While here, use a longer name for the 'test' alias as well since that is
also short and meaningful enough to make it not unlikely that somebody
would have a command in their $PATH which will shadow that as well.

Signed-off-by: Aaron Schrab <aaron@schrab.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
merge --no-edit: do not credit people involved in the side branch

The credit lines "By" and "Via" to credit authors and committers for
their contributions on the side branch are meant as a hint to the
integrator to decide whom to mention in the log message text.  After
the integrator saves the message in the editor, they are meant to go
away and that is why they are commented out.

When a merge is recorded without editing the generated message,
however, its contents do not go through the normal stripspace()
and these lines are left in the merge.

Stop producing them when we know the merge is going to be recorded
without editing, i.e. when --no-edit is given.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
Merge branch 'aw/rebase-am-failure-detection' into next

Save output from format-patch command in a temporary file, just in
case it aborts, to give a better failure-case behaviour.

* aw/rebase-am-failure-detection:
  rebase: Handle cases where format-patch fails
Merge branch 'mz/pick-unborn' into next

Allows "git cherry-pick $commit" when you do not have any history
behind HEAD yet.

* mz/pick-unborn:
  learn to pick/revert into unborn branch
  tests: move test_cmp_rev to test-lib-functions
Merge branch 'ta/remove-stale-translated-tut' into next

Remove a translation of a document that was left stale.

* ta/remove-stale-translated-tut:
  Remove Documentation/pt_BR/gittutorial.txt
Merge branch 'er/stop-recommending-parsecvs' into next

Stop recommending a defunct third-party software.

* er/stop-recommending-parsecvs:
  Remove the suggestion to use parsecvs, which is currently broken.
Merge branch 'as/test-name-alias-uniquely' into next

A few short-and-bland aliases used in the tests were interfering
with git-custom command in user's $PATH.

* as/test-name-alias-uniquely:
  Use longer alias names in subdirectory tests
Merge branch 'jc/maint-fmt-merge-msg-no-edit-lose-credit' into next

Stop spending cycles to compute information to be placed on
commented lines in "merge --no-edit".

* jc/maint-fmt-merge-msg-no-edit-lose-credit:
  merge --no-edit: do not credit people involved in the side branch
Merge branch 'er/python-version-requirements' into next

Some python scripts we ship cannot be run with old versions of the
interpreter.

* er/python-version-requirements:
  Add checks to Python scripts for version dependencies.