From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=0.3 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE,RDNS_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 Received: (qmail 10052 invoked from network); 12 Mar 2020 18:07:50 -0000 Received-SPF: pass (primenet.com.au: domain of zsh.org designates 203.24.36.2 as permitted sender) receiver=inbox.vuxu.org; client-ip=203.24.36.2 envelope-from= Received: from unknown (HELO primenet.com.au) (203.24.36.2) by inbox.vuxu.org with ESMTP; 12 Mar 2020 18:07:50 -0000 Received: (qmail 4353 invoked by alias); 12 Mar 2020 18:07:12 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: List-Unsubscribe: X-Seq: 45541 Received: (qmail 15813 invoked by uid 1010); 12 Mar 2020 18:07:12 -0000 X-Qmail-Scanner-Diagnostics: from out3-smtp.messagingengine.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.102.2/25744. spamassassin: 3.4.2. Clear:RC:0(66.111.4.27):SA:0(-1.9/5.0):. Processed in 3.752461 secs); 12 Mar 2020 18:07:12 -0000 X-Envelope-From: danielsh@apache.org X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: softfail (ns1.primenet.com.au: transitioning SPF record at amazonses.com does not designate 66.111.4.27 as permitted sender) X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedruddvhedguddutdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecuogfggedutddqvdejucdlgedtmdenucfjughrpe fhvffufffkofgjfhgggfestdektddtredttdenucfhrhhomhepffgrnhhivghlucfuhhgr hhgrfhcuoegurghnihgvlhhshhesrghprggthhgvrdhorhhgqeenucfkphepjeelrdduje eirdehledrudehvdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhl fhhrohhmpegurghnihgvlhhshhesrghprggthhgvrdhorhhg X-ME-Proxy: From: Daniel Shahaf 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 Message-Id: <20200312180623.5751-3-danielsh@tarpaulin.shahaf.local2> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200312180623.5751-1-danielsh@tarpaulin.shahaf.local2> References: <20200312180623.5751-1-danielsh@tarpaulin.shahaf.local2> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Qmail-Scanner-2.11: added fake Content-Type header Content-Type: text/plain --- 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 + +