# [PATCH] fixup! worktree move: new command

4 messages from 2017-01-25 to 2017-01-30. Participants: Johannes Schindelin, Junio C Hamano.
Thread: https://gitlist.dev/t/44967

## Johannes Schindelin, 2017-01-25 13:04

Subject: [PATCH] fixup! worktree move: new command
Message-ID: <4f4ae057cd4d72d5b945a856deacd921fb5e7977.1485349447.git.johannes.schindelin@gmx.de>
URL: https://gitlist.dev/e/4f4ae057cd4d72d5b945a856deacd921fb5e7977.1485349447.git.johannes.schindelin%40gmx.de

```
This is required for the test to pass on Windows, where $TRASH_DIRECTORY
is a POSIX path, while Git works with Windows paths instead. Using
`$(pwd)` is the common workaround: it reports a Windows path (while `$PWD`
would report the POSIX equivalent which, however, would only be understood
by shell and Perl scripts).

Duy, if you re-roll the `worktree-move` patch series, would you terribly
mind squashing this in?

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
Based-On: pu at https://github.com/dscho/git
Fetch-Base-Via: git fetch https://github.com/dscho/git pu
Published-As: https://github.com/dscho/git/releases/tag/nd/worktree-move-fixup-v1
Fetch-It-Via: git fetch https://github.com/dscho/git nd/worktree-move-fixup-v1

 t/t2028-worktree-move.sh | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/t/t2028-worktree-move.sh b/t/t2028-worktree-move.sh
index 084acc6c6d..b3105eaaed 100755
--- a/t/t2028-worktree-move.sh
+++ b/t/t2028-worktree-move.sh
@@ -71,13 +71,14 @@ test_expect_success 'move locked worktree' '
 '
 
 test_expect_success 'move worktree' '
+	toplevel="$(pwd)" &&
 	git worktree move source destination &&
 	test_path_is_missing source &&
 	git worktree list --porcelain | grep "^worktree" >actual &&
 	cat <<-EOF >expected &&
-	worktree $TRASH_DIRECTORY
-	worktree $TRASH_DIRECTORY/destination
-	worktree $TRASH_DIRECTORY/elsewhere
+	worktree $toplevel
+	worktree $toplevel/destination
+	worktree $toplevel/elsewhere
 	EOF
 	test_cmp expected actual &&
 	git -C destination log --format=%s >actual2 &&

base-commit: 8ef3497bf10296c74058e87d9c5b93372cad5137
-- 
2.11.0.windows.3.498.g86d49cc

```

## Johannes Schindelin, 2017-01-27 10:53

Subject: Re: [PATCH] fixup! worktree move: new command
Message-ID: <alpine.DEB.2.20.1701271150200.3469@virtualbox>
URL: https://gitlist.dev/e/alpine.DEB.2.20.1701271150200.3469%40virtualbox
In-Reply-To: <4f4ae057cd4d72d5b945a856deacd921fb5e7977.1485349447.git.johannes.schindelin@gmx.de>

```
Hi Junio,

On Wed, 25 Jan 2017, Johannes Schindelin wrote:

> This is required for the test to pass on Windows, where $TRASH_DIRECTORY
> is a POSIX path, while Git works with Windows paths instead. Using
> `$(pwd)` is the common workaround: it reports a Windows path (while `$PWD`
> would report the POSIX equivalent which, however, would only be understood
> by shell and Perl scripts).
> 
> Duy, if you re-roll the `worktree-move` patch series, would you terribly
> mind squashing this in?
> 
> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
> ---

Given that you add all kinds of SQUASH patches in `pu` that have not even
always been discussed on the mailing list, I would like to kindly ask you
to please add this patch to the nd/worktree-move branch for the time being
(i.e. until Duy responds), so that I am not continuously pestered by
failing Continuous Integration builds about a problem for which I have
provided a fix already.

Thanks,
Johannes

```

## Junio C Hamano, 2017-01-27 17:51

Subject: Re: [PATCH] fixup! worktree move: new command
Message-ID: <xmqqwpdgz8zq.fsf@gitster.mtv.corp.google.com>
URL: https://gitlist.dev/e/xmqqwpdgz8zq.fsf%40gitster.mtv.corp.google.com
In-Reply-To: <alpine.DEB.2.20.1701271150200.3469@virtualbox>

```
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:

> always been discussed on the mailing list, I would like to kindly ask you
> to please add this patch to the nd/worktree-move branch for the time being
> (i.e. until Duy responds),

The tip of 'pu' (or anything beyond the tip of 'jch') is not always
expected to pass test or even build, and unless I know the OP is
leaky or usually slow, a "fixup!" that directly addresses the OP
tends to be left for the OP to pick up [*1*] to avoid "ah, you sent
a reroll but I already had one squashed locally", which is confusing
to both myself and OP (and adds burden to me).

It seems that OP is slower to respond than his usual, so I'll add it
to the tip of the topic so that it won't be lost.


[Footnote]

*1* It still is used on my end to leave a mental note to myself that
    the topic is expected/waiting to be rerolled, but that is not
    something you can read in "git log --first-parent master..pu".

```

## Johannes Schindelin, 2017-01-30 12:24

Subject: Re: [PATCH] fixup! worktree move: new command
Message-ID: <alpine.DEB.2.20.1701301317500.3469@virtualbox>
URL: https://gitlist.dev/e/alpine.DEB.2.20.1701301317500.3469%40virtualbox
In-Reply-To: <xmqqwpdgz8zq.fsf@gitster.mtv.corp.google.com>

```
Hi Junio,

On Fri, 27 Jan 2017, Junio C Hamano wrote:

> The tip of 'pu' (or anything beyond the tip of 'jch') is not always
> expected to pass test or even build, [...]

This makes `pu` a lot less useful than it could be.

And we could easily improve the situation simply by changing the rule ever
so slightly: when a build, or a test, fails in `pu` and there exists a
fix, this fix should go into `pu` ASAP.

As you point out later in your mail, the fixup! or SQUASH! commit is a
very convenient reminder that a particular branch is still "under
construction". That is, changing the rule as I proposed above will not
only help the Continuous Integration [*1*] to avoid reporting duplicates,
it will also help us improve the project faster.

Ciao,
Johannes

Footnote *1*: It appears that there may be the misconception floating
around that Continuous Integration is designed to annoy developers by
pointing out unportable or unbuildable code. Once you realize, though,
that it detects and reports code that is below our existing code's
quality, no doubt you will agree that it is a convenient tool to relieve
reviewers from tedious work that can be done by a machine as well.

```
