zsh-workers
 help / color / mirror / code / Atom feed
From: Daniel Shahaf <danielsh@apache.org>
To: zsh-workers@zsh.org
Subject: [PATCH 3/3] internal: vcs_info git: Add a test case repository for rebase-apply situations
Date: Thu, 12 Mar 2020 18:06:23 +0000	[thread overview]
Message-ID: <20200312180623.5751-3-danielsh@tarpaulin.shahaf.local2> (raw)
In-Reply-To: <20200312180623.5751-1-danielsh@tarpaulin.shahaf.local2>

---
 Functions/VCS_Info/test-repo-git-rebase-apply | 49 +++++++++++++++++++
 1 file changed, 49 insertions(+)
 create mode 100755 Functions/VCS_Info/test-repo-git-rebase-apply

diff --git a/Functions/VCS_Info/test-repo-git-rebase-apply b/Functions/VCS_Info/test-repo-git-rebase-apply
new file mode 100755
index 000000000..cb4ea4f58
--- /dev/null
+++ b/Functions/VCS_Info/test-repo-git-rebase-apply
@@ -0,0 +1,49 @@
+#!/usr/local/bin/zsh -f
+#
+# This script creates a test repository for testing the git backend's behaviour during rebase-apply operations.
+#
+# It works in ./vcs-test/.
+#
+# Suggested zshrc settings:
+#
+#     autoload vcs_info
+#     precmd() { vcs_info; typeset -pm vcs\* }
+#     zstyle ':vcs_info:*' actionformats %m
+#     zstyle ':vcs_info:*' patch-format '[%n+%c=%a] [%p] [%u]'
+#     zstyle :vcs_info:\*gen-applied-string\* hooks f1
+#     +vi-f1() { typeset -p argv hook_com }
+#     zstyle :vcs_info:\*gen-unapplied-string\* hooks f2
+#     +vi-f2() { typeset -p argv hook_com }
+#     zstyle :vcs_info:\* get-unapplied true
+#
+mkdir "vcs-test"
+cd "vcs-test"
+git init
+
+append_lines() { for 1; do echo line from r$1 >> iota && git commit -am "r$1: Append a line"; done }
+
+echo "This is the file 'iota'." > iota
+git add iota
+git commit -m "r1: Add iota"
+git tag rebase_onto_this HEAD
+
+# Make another change to iota
+append_lines 2
+git tag rebase_from_this HEAD
+
+# Make non-conflicting changes
+for 1 in 3 4 5 6; do
+    touch kappa$1
+    git add kappa$1
+    git commit -m "r${1}: non-conflicting change"
+done
+
+# Make more changes to iota
+append_lines 7 8 9
+
+# Specify a rebase that would create the history [1,3,4,5,6,7,8,9].
+# This will conflict because r7 depends on r2 which is not included.
+git checkout -b myref
+git rebase --onto=rebase_onto_this rebase_from_this myref
+
+

      parent reply	other threads:[~2020-03-12 18:07 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-12 18:06 [PATCH 1/3] vcs_info git: In non-interactive rebases, compute patch names for unapplied patches Daniel Shahaf
2020-03-12 18:06 ` [PATCH 2/3] vcs_info git: In non-interactive rebases, obtain applied patches' names Daniel Shahaf
2020-03-12 18:06 ` Daniel Shahaf [this message]

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=20200312180623.5751-3-danielsh@tarpaulin.shahaf.local2 \
    --to=danielsh@apache.org \
    --cc=zsh-workers@zsh.org \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

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