<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/git-p4.py, branch v2.26.3</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.26.3</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.26.3'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2020-01-30T20:21:13Z</updated>
<entry>
<title>git-p4: avoid leak of file handle when cloning</title>
<updated>2020-01-30T20:21:13Z</updated>
<author>
<name>Luke Diamand</name>
<email>luke@diamand.org</email>
</author>
<published>2020-01-30T11:50:34Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=43f33e492af65d008045ee0695d0f17434e8c3c9'/>
<id>urn:sha1:43f33e492af65d008045ee0695d0f17434e8c3c9</id>
<content type='text'>
Spotted by Eric Sunshine:

    https://public-inbox.org/git/CAPig+cRx3hG64nuDie69o_gdX39F=sR6D8LyA7J1rCErgu0aMA@mail.gmail.com/

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: check for access to remote host earlier</title>
<updated>2020-01-30T20:20:58Z</updated>
<author>
<name>Luke Diamand</name>
<email>luke@diamand.org</email>
</author>
<published>2020-01-29T11:12:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=19fa5ac333134fc3aa1e462780c4690177474ade'/>
<id>urn:sha1:19fa5ac333134fc3aa1e462780c4690177474ade</id>
<content type='text'>
Check we can talk to the remote host before starting the git-fastimport
subchild.

Otherwise we fail to connect, and then exit, leaving git-fastimport
still running since we did not wait() for it.

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: cleanup better on error exit</title>
<updated>2020-01-30T20:20:58Z</updated>
<author>
<name>Luke Diamand</name>
<email>luke@diamand.org</email>
</author>
<published>2020-01-29T11:12:45Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=6026aff5bbe7389fa276188237b58afbef1b07ff'/>
<id>urn:sha1:6026aff5bbe7389fa276188237b58afbef1b07ff</id>
<content type='text'>
After an error, git-p4 calls die(). This just exits, and leaves child
processes still running.

Instead of calling die(), raise an exception and catch it where the
child process(es) (git-fastimport) are created.

This was analyzed in detail here:

    https://public-inbox.org/git/20190227094926.GE19739@szeder.dev/

This change does not address the particular issue of p4CmdList()
invoking a subchild and not waiting for it on error.

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: create helper function importRevisions()</title>
<updated>2020-01-30T20:20:58Z</updated>
<author>
<name>Luke Diamand</name>
<email>luke@diamand.org</email>
</author>
<published>2020-01-29T11:12:44Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ca5b5cce6290351f8cb63ee4ff466ed4a2285319'/>
<id>urn:sha1:ca5b5cce6290351f8cb63ee4ff466ed4a2285319</id>
<content type='text'>
This makes it easier to try/catch around this block of code to ensure
cleanup following p4 failures is handled properly.

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: disable some pylint warnings, to get pylint output to something manageable</title>
<updated>2020-01-30T20:20:58Z</updated>
<author>
<name>Luke Diamand</name>
<email>luke@diamand.org</email>
</author>
<published>2020-01-29T11:12:43Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=4c1d58675d07296adb2cf40b4b1c24f8d7a20d75'/>
<id>urn:sha1:4c1d58675d07296adb2cf40b4b1c24f8d7a20d75</id>
<content type='text'>
pylint is incredibly useful for finding bugs, but git-p4 has never used
it, so there are a lot of warnings that while important, don't actually
result in bugs.

Let's turn those off for now, so we can get some useful output.

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: add P4CommandException to report errors talking to Perforce</title>
<updated>2020-01-30T20:20:57Z</updated>
<author>
<name>Luke Diamand</name>
<email>luke@diamand.org</email>
</author>
<published>2020-01-29T11:12:42Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=5c3d5020e66caad0418b5696ba0f3d013641fcdd'/>
<id>urn:sha1:5c3d5020e66caad0418b5696ba0f3d013641fcdd</id>
<content type='text'>
Currently when there is a P4 error, git-p4 calls die() which just exits.

This then leaves the git-fast-import process still running, and can even
leave p4 itself still running.

As a result, git-p4 fails to exit cleanly. This is a particular problem
for people running the unit tests in regression.

Use this exception to report errors upwards, cleaning up as the error
propagates.

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: make closeStreams() idempotent</title>
<updated>2020-01-30T20:20:57Z</updated>
<author>
<name>Luke Diamand</name>
<email>luke@diamand.org</email>
</author>
<published>2020-01-29T11:12:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=837b3a6376804ec70b88f06c3f702a38c59196c3'/>
<id>urn:sha1:837b3a6376804ec70b88f06c3f702a38c59196c3</id>
<content type='text'>
Ensure that we can safely call self.closeStreams() multiple times, and
can also call it even if there is no git fast-import stream at all.

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>Merge branch 'bk/p4-misc-usability'</title>
<updated>2020-01-02T20:38:29Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2020-01-02T20:38:29Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=bc855232bcb14599890ddf8b97f7e94290f3a1f4'/>
<id>urn:sha1:bc855232bcb14599890ddf8b97f7e94290f3a1f4</id>
<content type='text'>
Miscellaneous small UX improvements on "git-p4".

* bk/p4-misc-usability:
  git-p4: show detailed help when parsing options fail
  git-p4: yes/no prompts should sanitize user text
</content>
</entry>
<entry>
<title>git-p4: show detailed help when parsing options fail</title>
<updated>2019-12-16T20:32:13Z</updated>
<author>
<name>Ben Keene</name>
<email>seraphire@gmail.com</email>
</author>
<published>2019-12-16T14:02:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=608e380502f754b50ead6c7e6c3f5ff5ee8eca33'/>
<id>urn:sha1:608e380502f754b50ead6c7e6c3f5ff5ee8eca33</id>
<content type='text'>
When a user provides invalid parameters to git-p4, the program
reports the failure but does not provide the correct command syntax.

Add an exception handler to the command-line argument parser to display
the command's specific command line parameter syntax when an exception
is thrown. Rethrow the exception so the current behavior is retained.

Signed-off-by: Ben Keene &lt;seraphire@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>git-p4: yes/no prompts should sanitize user text</title>
<updated>2019-12-16T20:31:47Z</updated>
<author>
<name>Ben Keene</name>
<email>seraphire@gmail.com</email>
</author>
<published>2019-12-16T14:02:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e2aed5fd5bfb0381a6f69373c01ef09d70467a5c'/>
<id>urn:sha1:e2aed5fd5bfb0381a6f69373c01ef09d70467a5c</id>
<content type='text'>
When prompting the user interactively for direction, the tests are
not forgiving of user input format.

For example, the first query asks for a yes/no response. If the user
enters the full word "yes" or "no" or enters a capital "Y" the test
will fail.

Create a new function, prompt(prompt_text) where
  * prompt_text is the text prompt for the user
  * returns a single character where valid return values are
      found by inspecting prompt_text for single characters
      surrounded by square brackets

This new function must  prompt the user for input and sanitize it by
converting the response to a lower case string, trimming leading and
trailing spaces, and checking if the first character is in the list
of choices. If it is, return the first letter.

Change the current references to raw_input() to use this new function.

Since the method requires the returned text to be one of the available
choices, remove the loop from the calling code that handles response
verification.

Thanks-to: Denton Liu &lt;liu.denton@gmail.com&gt;
Signed-off-by: Ben Keene &lt;seraphire@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
