git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Schindelin <johannes.schindelin@gmx.de>
To: git@vger.kernel.org
Cc: Junio C Hamano <gitster@pobox.com>
Subject: [PATCH v2 0/3] Additional rebase -i tests
Date: Thu, 7 Jul 2016 17:52:46 +0200 (CEST)	[thread overview]
Message-ID: <cover.1467906747.git.johannes.schindelin@gmx.de> (raw)
In-Reply-To: <cover.1467210629.git.johannes.schindelin@gmx.de>

This is just another patch series in preparation for the rebase--helper.

Relative to v1 of this patch series,

- the grammo fix was backed out because it was picked up separately,

- two new tests were introduced, one demonstrating a bug, the other one
  ensuring that the rebase--helper does not introduce a regression (this
  test actually helped me debug and fix a regression in some previous
  revision of the rebase--helper)


Johannes Schindelin (3):
  t3404: add a test for the --gpg-sign option
  rebase -i: demonstrate a bug with --autosquash
  rebase -i: we allow extra spaces after fixup!/squash!

 t/t3404-rebase-interactive.sh |  8 ++++++++
 t/t3415-rebase-autosquash.sh  | 33 +++++++++++++++++++++++++++++++++
 2 files changed, 41 insertions(+)

Published-As: https://github.com/dscho/git/releases/tag/rebase-i-tests-v2
Interdiff vs v1:

 diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh
 index 4c96075..aa393d2 100755
 --- a/t/t3404-rebase-interactive.sh
 +++ b/t/t3404-rebase-interactive.sh
 @@ -60,7 +60,7 @@ test_expect_success 'setup' '
  	test_commit P fileP
  '
  
 -# "exec" commands are run with the user shell by default, but this may
 +# "exec" commands are ran with the user shell by default, but this may
  # be non-POSIX. For example, if SHELL=zsh then ">file" doesn't work
  # to create a file. Unsetting SHELL avoids such non-portable behavior
  # in tests. It must be exported for it to take effect where needed.
 @@ -1281,11 +1281,12 @@ test_expect_success 'editor saves as CR/LF' '
  	)
  '
  
 -EPIPHANY="'"
 +SQ="'"
  test_expect_success 'rebase -i --gpg-sign=<key-id>' '
  	set_fake_editor &&
 -	FAKE_LINES="edit 1" git rebase -i --gpg-sign=\" HEAD^ >out 2>err &&
 -	grep "$EPIPHANY-S\"$EPIPHANY" err
 +	FAKE_LINES="edit 1" git rebase -i --gpg-sign="\"S I Gner\"" HEAD^ \
 +		>out 2>err &&
 +	grep "$SQ-S\"S I Gner\"$SQ" err
  '
  
  test_done
 diff --git a/t/t3415-rebase-autosquash.sh b/t/t3415-rebase-autosquash.sh
 index 8f53e54..48346f1 100755
 --- a/t/t3415-rebase-autosquash.sh
 +++ b/t/t3415-rebase-autosquash.sh
 @@ -271,4 +271,37 @@ test_expect_success 'autosquash with custom inst format' '
  	test 2 = $(git cat-file commit HEAD^ | grep squash | wc -l)
  '
  
 +set_backup_editor () {
 +	write_script backup-editor.sh <<-\EOF
 +	cp "$1" .git/backup-"$(basename "$1")"
 +	EOF
 +	test_set_editor "$PWD/backup-editor.sh"
 +}
 +
 +test_expect_failure 'autosquash with multiple empty patches' '
 +	test_tick &&
 +	git commit --allow-empty -m "empty" &&
 +	test_tick &&
 +	git commit --allow-empty -m "empty2" &&
 +	test_tick &&
 +	>fixup &&
 +	git add fixup &&
 +	git commit --fixup HEAD^^ &&
 +	(
 +		set_backup_editor &&
 +		GIT_USE_REBASE_HELPER=false \
 +		git rebase -i --force-rebase --autosquash HEAD~4 &&
 +		grep empty2 .git/backup-git-rebase-todo
 +	)
 +'
 +
 +test_expect_success 'extra spaces after fixup!' '
 +	base=$(git rev-parse HEAD) &&
 +	test_commit to-fixup &&
 +	git commit --allow-empty -m "fixup!  to-fixup" &&
 +	git rebase -i --autosquash --keep-empty HEAD~2 &&
 +	parent=$(git rev-parse HEAD^) &&
 +	test $base = $parent
 +'
 +
  test_done

-- 
2.9.0.278.g1caae67

base-commit: 5c589a73de4394ad125a4effac227b3aec856fa1

  parent reply	other threads:[~2016-07-07 15:53 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-29 14:30 [PATCH 0/2] Late edits to the rebase -i tests Johannes Schindelin
2016-06-29 14:31 ` [PATCH 1/2] t3404: fix another typo Johannes Schindelin
2016-06-29 15:11   ` Pranit Bauva
2016-06-29 15:26   ` Junio C Hamano
2016-06-29 15:31     ` Johannes Schindelin
2016-06-29 18:06       ` Junio C Hamano
2016-06-30  8:17         ` Johannes Schindelin
2016-06-29 14:31 ` [PATCH 2/2] t3404: add a test for the --gpg-sign option Johannes Schindelin
2016-06-29 18:30   ` Junio C Hamano
2016-06-30  8:25     ` Johannes Schindelin
2016-07-01 16:06       ` Junio C Hamano
2016-07-02  7:38         ` Johannes Schindelin
2016-07-06 14:51           ` Junio C Hamano
2016-07-06 15:34             ` Johannes Schindelin
2016-07-06 19:02               ` Junio C Hamano
2016-07-07 15:23                 ` Johannes Schindelin
2016-07-07 15:52 ` Johannes Schindelin [this message]
2016-07-07 15:52   ` [PATCH v2 1/3] " Johannes Schindelin
2016-07-07 15:52   ` [PATCH v2 2/3] rebase -i: demonstrate a bug with --autosquash Johannes Schindelin
2016-07-07 15:52   ` [PATCH v2 3/3] rebase -i: we allow extra spaces after fixup!/squash! Johannes Schindelin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cover.1467906747.git.johannes.schindelin@gmx.de \
    --to=johannes.schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).