<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/t/t9800-git-p4-basic.sh, branch gitk-resize-error</title>
<subtitle>Fork of git SCM with my patches.</subtitle>
<id>http://git.kilabit.info/git/atom?h=gitk-resize-error</id>
<link rel='self' href='http://git.kilabit.info/git/atom?h=gitk-resize-error'/>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/'/>
<updated>2021-12-13T18:29:48Z</updated>
<entry>
<title>t6000-t9999: detect and signal failure within loop</title>
<updated>2021-12-13T18:29:48Z</updated>
<author>
<name>Eric Sunshine</name>
<email>sunshine@sunshineco.com</email>
</author>
<published>2021-12-09T05:11:15Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=0c51d6b4aec9f1959d148960cb55155b676cec78'/>
<id>urn:sha1:0c51d6b4aec9f1959d148960cb55155b676cec78</id>
<content type='text'>
Failures within `for` and `while` loops can go unnoticed if not detected
and signaled manually since the loop itself does not abort when a
contained command fails, nor will a failure necessarily be detected when
the loop finishes since the loop returns the exit code of the last
command it ran on the final iteration, which may not be the command
which failed. Therefore, detect and signal failures manually within
loops using the idiom `|| return 1` (or `|| exit 1` within subshells).

Signed-off-by: Eric Sunshine &lt;sunshine@sunshineco.com&gt;
Reviewed-by: Elijah Newren &lt;newren@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>tests(git-p4): transition to the default branch name `main`</title>
<updated>2020-11-19T23:44:18Z</updated>
<author>
<name>Johannes Schindelin</name>
<email>johannes.schindelin@gmx.de</email>
</author>
<published>2020-11-18T23:44:44Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=46a29020bb98bf086ef75036abf82ae8721e7466'/>
<id>urn:sha1:46a29020bb98bf086ef75036abf82ae8721e7466</id>
<content type='text'>
In the previous commits, we adjusted the test suite to use the branch
name `main` for initial branches.

The `git p4`-related tests are a bit harder to adjust because `git p4`
uses the ref `refs/heads/p4/master` to track the remote branches, and
for now, we do not want to change that (this might be the subject of a
future patch series). We only need to adjust for the actual initial
branch name to be changed to `main`.

This allows us to define `GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main`
for those tests.

Signed-off-by: Johannes Schindelin &lt;johannes.schindelin@gmx.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>tests: mark tests relying on the current default for `init.defaultBranch`</title>
<updated>2020-11-19T23:44:17Z</updated>
<author>
<name>Johannes Schindelin</name>
<email>johannes.schindelin@gmx.de</email>
</author>
<published>2020-11-18T23:44:19Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=334afbc76fbd4a8d850946a2b450ba036365b554'/>
<id>urn:sha1:334afbc76fbd4a8d850946a2b450ba036365b554</id>
<content type='text'>
In addition to the manual adjustment to let the `linux-gcc` CI job run
the test suite with `master` and then with `main`, this patch makes sure
that GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME is set in all test scripts
that currently rely on the initial branch name being `master by default.

To determine which test scripts to mark up, the first step was to
force-set the default branch name to `master` in

- all test scripts that contain the keyword `master`,

- t4211, which expects `t/t4211/history.export` with a hard-coded ref to
  initialize the default branch,

- t5560 because it sources `t/t556x_common` which uses `master`,

- t8002 and t8012 because both source `t/annotate-tests.sh` which also
  uses `master`)

This trick was performed by this command:

	$ sed -i '/^ *\. \.\/\(test-lib\|lib-\(bash\|cvs\|git-svn\)\|gitweb-lib\)\.sh$/i\
	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master\
	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME\
	' $(git grep -l master t/t[0-9]*.sh) \
	t/t4211*.sh t/t5560*.sh t/t8002*.sh t/t8012*.sh

After that, careful, manual inspection revealed that some of the test
scripts containing the needle `master` do not actually rely on a
specific default branch name: either they mention `master` only in a
comment, or they initialize that branch specificially, or they do not
actually refer to the current default branch. Therefore, the
aforementioned modification was undone in those test scripts thusly:

	$ git checkout HEAD -- \
		t/t0027-auto-crlf.sh t/t0060-path-utils.sh \
		t/t1011-read-tree-sparse-checkout.sh \
		t/t1305-config-include.sh t/t1309-early-config.sh \
		t/t1402-check-ref-format.sh t/t1450-fsck.sh \
		t/t2024-checkout-dwim.sh \
		t/t2106-update-index-assume-unchanged.sh \
		t/t3040-subprojects-basic.sh t/t3301-notes.sh \
		t/t3308-notes-merge.sh t/t3423-rebase-reword.sh \
		t/t3436-rebase-more-options.sh \
		t/t4015-diff-whitespace.sh t/t4257-am-interactive.sh \
		t/t5323-pack-redundant.sh t/t5401-update-hooks.sh \
		t/t5511-refspec.sh t/t5526-fetch-submodules.sh \
		t/t5529-push-errors.sh t/t5530-upload-pack-error.sh \
		t/t5548-push-porcelain.sh \
		t/t5552-skipping-fetch-negotiator.sh \
		t/t5572-pull-submodule.sh t/t5608-clone-2gb.sh \
		t/t5614-clone-submodules-shallow.sh \
		t/t7508-status.sh t/t7606-merge-custom.sh \
		t/t9302-fast-import-unpack-limit.sh

We excluded one set of test scripts in these commands, though: the range
of `git p4` tests. The reason? `git p4` stores the (foreign) remote
branch in the branch called `p4/master`, which is obviously not the
default branch. Manual analysis revealed that only five of these tests
actually require a specific default branch name to pass; They were
modified thusly:

	$ sed -i '/^ *\. \.\/lib-git-p4\.sh$/i\
	GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master\
	export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME\
	' t/t980[0167]*.sh t/t9811*.sh

Signed-off-by: Johannes Schindelin &lt;johannes.schindelin@gmx.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>t: drop debug `cat` calls</title>
<updated>2020-02-24T19:18:25Z</updated>
<author>
<name>Martin Ågren</name>
<email>martin.agren@gmail.com</email>
</author>
<published>2020-02-23T08:48:36Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=3c29e21eb047be390d3908d429669cdca3037d9f'/>
<id>urn:sha1:3c29e21eb047be390d3908d429669cdca3037d9f</id>
<content type='text'>
We `cat` files, but don't inspect or grab the contents in any way.
Unlike in an earlier commit, there is no reason to suspect that these
files could be missing, so `cat`-ing them is just wasted effort.

Signed-off-by: Martin Ågren &lt;martin.agren@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>git p4 test: use 'test_atexit' to kill p4d and the watchdog process</title>
<updated>2019-03-14T03:34:39Z</updated>
<author>
<name>Johannes Schindelin</name>
<email>johannes.schindelin@gmx.de</email>
</author>
<published>2019-03-13T12:24:15Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=99e37c2560ecb1cc44bb743a2e4aaaedb5da1a90'/>
<id>urn:sha1:99e37c2560ecb1cc44bb743a2e4aaaedb5da1a90</id>
<content type='text'>
Use 'test_atexit' to run cleanup commands to stop 'p4d' at the end of
the test script or upon interrupt or failure, as it is shorter,
simpler, and more robust than registering such cleanup commands in the
trap on EXIT in the test scripts.

Note that one of the test scripts, 't9801-git-p4-branch.sh', stops and
then re-starts 'p4d' twice in the middle of the script; take care that
the cleanup functions to stop 'p4d' are only registered once.

Note also that 'git p4' tests invoke different functions in the trap
on EXIT ('cleanup') and in the last test before 'test_done'
('kill_p4d').  Register both of these functions with 'test_atexit' for
now, and a a later patch in this series will then clean up the
redundancy.

Signed-off-by: Johannes Schindelin &lt;johannes.schindelin@gmx.de&gt;
Signed-off-by: SZEDER Gábor &lt;szeder.dev@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>git-p4: add the `p4-pre-submit` hook</title>
<updated>2018-08-01T20:37:18Z</updated>
<author>
<name>Chen Bin</name>
<email>chenbin.sh@gmail.com</email>
</author>
<published>2018-07-27T11:22:22Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=251c8c501faf7a7910edb7c9e19692988dcac6a8'/>
<id>urn:sha1:251c8c501faf7a7910edb7c9e19692988dcac6a8</id>
<content type='text'>
The `p4-pre-submit` hook is executed before git-p4 submits code.
If the hook exits with non-zero value, submit process not start.

Signed-off-by: Chen Bin &lt;chenbin.sh@gmail.com&gt;
Reviewed-by: Luke Diamand &lt;luke@diamand.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'gv/p4-multi-path-commit-fix'</title>
<updated>2016-12-27T08:11:43Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2016-12-27T08:11:43Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=d7dcd52a42fc3d93c503da626fb669b3eee46ddc'/>
<id>urn:sha1:d7dcd52a42fc3d93c503da626fb669b3eee46ddc</id>
<content type='text'>
"git p4" that tracks multile p4 paths imported a single changelist
that touches files in these multiple paths as one commit, followed
by many empty commits.  This has been fixed.

* gv/p4-multi-path-commit-fix:
  git-p4: fix multi-path changelist empty commits
</content>
</entry>
<entry>
<title>git-p4: fix multi-path changelist empty commits</title>
<updated>2016-12-19T18:04:21Z</updated>
<author>
<name>George Vanburgh</name>
<email>gvanburgh@bloomberg.net</email>
</author>
<published>2016-12-17T22:11:23Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=9943e5b9799336460ecbbeb86e544cc4a1ad1254'/>
<id>urn:sha1:9943e5b9799336460ecbbeb86e544cc4a1ad1254</id>
<content type='text'>
When importing from multiple perforce paths - we may attempt to
import a changelist that contains files from two (or more) of these
depot paths. Currently, this results in multiple git commits - one
containing the changes, and the other(s) as empty commit(s). This
behavior was introduced in commit 1f90a64891 ("git-p4: reduce number
of server queries for fetches", 2015-12-19).

Reproduction Steps:

  1. Have a git repo cloned from a perforce repo using multiple
     depot paths (e.g. //depot/foo and //depot/bar).

  2. Submit a single change to the perforce repo that makes changes
     in both //depot/foo and //depot/bar.

  3. Run "git p4 sync" to sync the change from #2.

Change is synced as multiple commits, one for each depot path that
was affected.

Using a set, instead of a list inside p4ChangesForPaths() ensures
that each changelist is unique to the returned list, and therefore
only a single commit is generated for each changelist.

Reported-by: James Farwell &lt;jfarwell@vmware.com&gt;
Signed-off-by: George Vanburgh &lt;gvanburgh@bloomberg.net&gt;
Reviewed-by: Luke Diamand &lt;luke@diamand.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>git-p4: support git worktrees</title>
<updated>2016-12-14T00:04:53Z</updated>
<author>
<name>Luke Diamand</name>
<email>luke@diamand.org</email>
</author>
<published>2016-12-13T21:51:28Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=378f7be1e74661ff1480cc44a5f039ef85da7288'/>
<id>urn:sha1:378f7be1e74661ff1480cc44a5f039ef85da7288</id>
<content type='text'>
git-p4 would attempt to find the git directory using
its own specific code, which did not know about git
worktrees.

Rework it to use "git rev-parse --git-dir" instead.

Add test cases for worktree usage and specifying
git directory via --git-dir and $GIT_DIR.

Signed-off-by: Luke Diamand &lt;luke@diamand.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>git-p4: work with a detached head</title>
<updated>2015-11-24T20:20:15Z</updated>
<author>
<name>Luke Diamand</name>
<email>luke@diamand.org</email>
</author>
<published>2015-11-21T09:54:41Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=00ad6e3182bbe68a94eaedf322918e4f266d184f'/>
<id>urn:sha1:00ad6e3182bbe68a94eaedf322918e4f266d184f</id>
<content type='text'>
When submitting, git-p4 finds the current branch in
order to know if it is allowed to submit (configuration
"git-p4.allowSubmit").

On a detached head, detecting the branch would fail, and
git-p4 would report a cryptic error.

This change teaches git-p4 to recognise a detached head and
submit successfully.

Signed-off-by: Luke Diamand &lt;luke@diamand.org&gt;
Signed-off-by: Jeff King &lt;peff@peff.net&gt;
</content>
</entry>
</feed>
