<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/git.git/t/lib-git-p4.sh, branch sb/parse-options-codeformat</title>
<subtitle>github.com: git/git.git
</subtitle>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/git.git/'/>
<entry>
<title>git-p4: add failing tests for case-folding p4d</title>
<updated>2015-04-28T19:19:43+00:00</updated>
<author>
<name>Luke Diamand</name>
<email>luke@diamand.org</email>
</author>
<published>2015-04-28T09:08:01+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/git.git/commit/?id=e80967b28704930b4ca30f8dedf7ce0145c7eaa4'/>
<id>e80967b28704930b4ca30f8dedf7ce0145c7eaa4</id>
<content type='text'>
When p4d runs on a case-folding OS, git-p4 can end up getting
very confused. This adds failing tests to demonstrate the problem.

Signed-off-by: Luke Diamand &lt;luke@diamand.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When p4d runs on a case-folding OS, git-p4 can end up getting
very confused. This adds failing tests to demonstrate the problem.

Signed-off-by: Luke Diamand &lt;luke@diamand.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>git p4 test: do not pollute /tmp</title>
<updated>2014-01-22T16:06:19+00:00</updated>
<author>
<name>Pete Wyckoff</name>
<email>pw@padd.com</email>
</author>
<published>2014-01-21T23:16:44+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/git.git/commit/?id=0cf1b72a38e6190a7e614bbc53fbb81704a3d4af'/>
<id>0cf1b72a38e6190a7e614bbc53fbb81704a3d4af</id>
<content type='text'>
Generating the submit template for p4 uses tempfile.mkstemp(),
which by default puts files in /tmp.  For a test that fails,
possibly on purpose, this is not cleaned up.  Run with TMPDIR
pointing into the trash directory so the temp files go away
with the test results.

To do this required some other minor changes.  First, the editor
is launched using system(editor + " " + template_file), using
shell expansion to build the command string.  This doesn't work
if editor has a space in it.  And is generally unwise as it's
easy to fool the shell into doing extra work.  Exec the args
directly, without shell expansion.

Second, without shell expansion, the trick of "P4EDITOR=:" used
in the tests doesn't work.  Use a real command, true, as the
non-interactive editor for testing.

Signed-off-by: Pete Wyckoff &lt;pw@padd.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Generating the submit template for p4 uses tempfile.mkstemp(),
which by default puts files in /tmp.  For a test that fails,
possibly on purpose, this is not cleaned up.  Run with TMPDIR
pointing into the trash directory so the temp files go away
with the test results.

To do this required some other minor changes.  First, the editor
is launched using system(editor + " " + template_file), using
shell expansion to build the command string.  This doesn't work
if editor has a space in it.  And is generally unwise as it's
easy to fool the shell into doing extra work.  Exec the args
directly, without shell expansion.

Second, without shell expansion, the trick of "P4EDITOR=:" used
in the tests doesn't work.  Use a real command, true, as the
non-interactive editor for testing.

Signed-off-by: Pete Wyckoff &lt;pw@padd.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>git p4 test: run as user "author"</title>
<updated>2014-01-22T16:05:27+00:00</updated>
<author>
<name>Pete Wyckoff</name>
<email>pw@padd.com</email>
</author>
<published>2014-01-21T23:16:43+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/git.git/commit/?id=0055b56e10f77b1b5f5521b8ba3614f962a09288'/>
<id>0055b56e10f77b1b5f5521b8ba3614f962a09288</id>
<content type='text'>
The tests use author@example.com as the canonical submitter,
but he does not have an entry in the p4 users database.
This causes the generated change description to complain
that the git and p4 users disagree.  The complaint message
is still valid, but isn't useful in tests.  It was introduced
in 848de9c (git-p4: warn if git authorship won't be retained,
2011-05-13).

Fix t9813 to use @example.com instead of @localhost due to
change in p4_add_user().  Move the function into the git p4
test library so author can be added at initialization time.

Signed-off-by: Pete Wyckoff &lt;pw@padd.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The tests use author@example.com as the canonical submitter,
but he does not have an entry in the p4 users database.
This causes the generated change description to complain
that the git and p4 users disagree.  The complaint message
is still valid, but isn't useful in tests.  It was introduced
in 848de9c (git-p4: warn if git authorship won't be retained,
2011-05-13).

Fix t9813 to use @example.com instead of @localhost due to
change in p4_add_user().  Move the function into the git p4
test library so author can be added at initialization time.

Signed-off-by: Pete Wyckoff &lt;pw@padd.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>git p4 test: sanitize P4CHARSET</title>
<updated>2013-08-12T06:19:08+00:00</updated>
<author>
<name>kazuki saitoh</name>
<email>ksaitoh560@gmail.com</email>
</author>
<published>2013-08-10T20:15:12+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/git.git/commit/?id=799460316b87c2b0f26c3c0fcd99ae153f9f7358'/>
<id>799460316b87c2b0f26c3c0fcd99ae153f9f7358</id>
<content type='text'>
In the tests, p4d is started without using "internationalized
mode".  Make sure this environment variable is unset, otherwise
a mis-matched user setting would break the tests.  The error
message would be "Unicode clients require a unicode enabled server."

[pw: use unset, add commit text]

Signed-off-by: Kazuki Saitoh &lt;ksaitoh560@gmail.com&gt;
Signed-off-by: Pete Wyckoff &lt;pw@padd.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In the tests, p4d is started without using "internationalized
mode".  Make sure this environment variable is unset, otherwise
a mis-matched user setting would break the tests.  The error
message would be "Unicode clients require a unicode enabled server."

[pw: use unset, add commit text]

Signed-off-by: Kazuki Saitoh &lt;ksaitoh560@gmail.com&gt;
Signed-off-by: Pete Wyckoff &lt;pw@padd.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>git p4: cygwin p4 client does not mark read-only</title>
<updated>2013-01-27T06:00:39+00:00</updated>
<author>
<name>Pete Wyckoff</name>
<email>pw@padd.com</email>
</author>
<published>2013-01-27T03:11:17+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/git.git/commit/?id=e9df0f9c7a7fbaed924273d0a9b502171ed23b7c'/>
<id>e9df0f9c7a7fbaed924273d0a9b502171ed23b7c</id>
<content type='text'>
There are some old versions of p4, compiled for cygwin, that
treat read-only files differently.

Normally, a file that is not open is read-only, meaning that
"test -w" on the file is false.  This works on unix, and it works
on windows using the NT version of p4.  The cygwin version
of p4, though, changes the permissions, but does not set the
windows read-only attribute, so "test -w" returns false.

Notice this oddity and make the tests work, even on cygiwn.

Signed-off-by: Pete Wyckoff &lt;pw@padd.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
There are some old versions of p4, compiled for cygwin, that
treat read-only files differently.

Normally, a file that is not open is read-only, meaning that
"test -w" on the file is false.  This works on unix, and it works
on windows using the NT version of p4.  The cygwin version
of p4, though, changes the permissions, but does not set the
windows read-only attribute, so "test -w" returns false.

Notice this oddity and make the tests work, even on cygiwn.

Signed-off-by: Pete Wyckoff &lt;pw@padd.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>git p4 test: use LineEnd unix in windows tests too</title>
<updated>2013-01-27T06:00:39+00:00</updated>
<author>
<name>Pete Wyckoff</name>
<email>pw@padd.com</email>
</author>
<published>2013-01-27T03:11:15+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/git.git/commit/?id=e93f8695939bae73fbf5122a9a8f53637dce8e39'/>
<id>e93f8695939bae73fbf5122a9a8f53637dce8e39</id>
<content type='text'>
In all clients, even those created on windows, use unix line
endings.  This makes it possible to verify file contents without
doing OS-specific comparisons in all the tests.

Tests in t9802-git-p4-filetype.sh are used to make sure that
the other LineEnd options continue to work.

Signed-off-by: Pete Wyckoff &lt;pw@padd.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In all clients, even those created on windows, use unix line
endings.  This makes it possible to verify file contents without
doing OS-specific comparisons in all the tests.

Tests in t9802-git-p4-filetype.sh are used to make sure that
the other LineEnd options continue to work.

Signed-off-by: Pete Wyckoff &lt;pw@padd.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>git p4 test: translate windows paths for cygwin</title>
<updated>2013-01-27T06:00:39+00:00</updated>
<author>
<name>Pete Wyckoff</name>
<email>pw@padd.com</email>
</author>
<published>2013-01-27T03:11:11+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/git.git/commit/?id=cfa96496bd9e7828c5626e2cd1353e9fb7d3d0c7'/>
<id>cfa96496bd9e7828c5626e2cd1353e9fb7d3d0c7</id>
<content type='text'>
Native windows binaries do not understand posix-like
path mapping offered by cygwin.  Convert paths to native
using "cygpath --windows" before presenting them to p4d.

This is done using the AltRoots mechanism of p4.  Both the
posix and windows forms are put in the client specification,
allowing p4 to find its location by native path even though
the environment reports a different PWD.

Shell operations in tests will use the normal form of $cli,
which will look like a posix path in cygwin, while p4 will
use AltRoots to match against the windows form of the working
directory.

This mechanism also handles the symlink issue that was fixed in
23bd0c9 (git p4 test: use real_path to resolve p4 client
symlinks, 2012-06-27).  Now that every p4 client view has
an AltRoots with the real_path in it, explicitly calculating
the real_path elsewhere is not necessary.

Thanks-to: Sebastian Schuberth &lt;sschuberth@gmail.com&gt;
Thanks-to: Johannes Sixt &lt;j6t@kdbg.org&gt;

fixup! git p4 test: translate windows paths for cygwin

Signed-off-by: Pete Wyckoff &lt;pw@padd.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Native windows binaries do not understand posix-like
path mapping offered by cygwin.  Convert paths to native
using "cygpath --windows" before presenting them to p4d.

This is done using the AltRoots mechanism of p4.  Both the
posix and windows forms are put in the client specification,
allowing p4 to find its location by native path even though
the environment reports a different PWD.

Shell operations in tests will use the normal form of $cli,
which will look like a posix path in cygwin, while p4 will
use AltRoots to match against the windows form of the working
directory.

This mechanism also handles the symlink issue that was fixed in
23bd0c9 (git p4 test: use real_path to resolve p4 client
symlinks, 2012-06-27).  Now that every p4 client view has
an AltRoots with the real_path in it, explicitly calculating
the real_path elsewhere is not necessary.

Thanks-to: Sebastian Schuberth &lt;sschuberth@gmail.com&gt;
Thanks-to: Johannes Sixt &lt;j6t@kdbg.org&gt;

fixup! git p4 test: translate windows paths for cygwin

Signed-off-by: Pete Wyckoff &lt;pw@padd.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>git p4 test: start p4d inside its db dir</title>
<updated>2013-01-27T06:00:38+00:00</updated>
<author>
<name>Pete Wyckoff</name>
<email>pw@padd.com</email>
</author>
<published>2013-01-27T03:11:10+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/git.git/commit/?id=6492a1041a66f19589f6001400005a3913884882'/>
<id>6492a1041a66f19589f6001400005a3913884882</id>
<content type='text'>
This will avoid having to do native path conversion for
windows.  Also may be a bit cleaner always to know that p4d
has that working directory, instead of wherever the function
was called from.

Signed-off-by: Pete Wyckoff &lt;pw@padd.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This will avoid having to do native path conversion for
windows.  Also may be a bit cleaner always to know that p4d
has that working directory, instead of wherever the function
was called from.

Signed-off-by: Pete Wyckoff &lt;pw@padd.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>git p4 test: use client_view in t9806</title>
<updated>2013-01-27T06:00:38+00:00</updated>
<author>
<name>Pete Wyckoff</name>
<email>pw@padd.com</email>
</author>
<published>2013-01-27T03:11:09+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/git.git/commit/?id=50038ba92a22743be8c105e16fb559a6d96c3a7a'/>
<id>50038ba92a22743be8c105e16fb559a6d96c3a7a</id>
<content type='text'>
Use the standard client_view function from lib-git-p4.sh
instead of building one by hand.  This requires a bit of
rework, using the current value of $P4CLIENT for the client
name.  It also reorganizes the test to isolate changes to
$P4CLIENT and $cli in a subshell.

Signed-off-by: Pete Wyckoff &lt;pw@padd.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Use the standard client_view function from lib-git-p4.sh
instead of building one by hand.  This requires a bit of
rework, using the current value of $P4CLIENT for the client
name.  It also reorganizes the test to isolate changes to
$P4CLIENT and $cli in a subshell.

Signed-off-by: Pete Wyckoff &lt;pw@padd.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>git p4 test: avoid loop in client_view</title>
<updated>2013-01-27T06:00:38+00:00</updated>
<author>
<name>Pete Wyckoff</name>
<email>pw@padd.com</email>
</author>
<published>2013-01-27T03:11:08+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/git.git/commit/?id=6112541b444b52d5ac83f491eabefbf571da4997'/>
<id>6112541b444b52d5ac83f491eabefbf571da4997</id>
<content type='text'>
The printf command re-interprets the format string as
long as there are arguments to consume.  Use this to
simplify a for loop in the client_view() library function.

This requires a fix to one of the client_view callers.
An errant \n in the string was converted into a harmless
newline in the input to "p4 client -i", but now shows up
as a literal \n as passed through by "%s".  Remove the \n.

Based-on-patch-by: Junio C Hamano &lt;gitster@pobox.com&gt;
Signed-off-by: Pete Wyckoff &lt;pw@padd.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The printf command re-interprets the format string as
long as there are arguments to consume.  Use this to
simplify a for loop in the client_view() library function.

This requires a fix to one of the client_view callers.
An errant \n in the string was converted into a harmless
newline in the input to "p4 client -i", but now shows up
as a literal \n as passed through by "%s".  Remove the \n.

Based-on-patch-by: Junio C Hamano &lt;gitster@pobox.com&gt;
Signed-off-by: Pete Wyckoff &lt;pw@padd.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
