<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/git-p4.py, branch v2.36.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.36.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.36.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2022-02-09T22:21:00Z</updated>
<entry>
<title>Merge branch 'ab/config-based-hooks-2'</title>
<updated>2022-02-09T22:21:00Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2022-02-09T22:21:00Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c70bc338e9a35b45263c3c68913ad516e9e70d62'/>
<id>urn:sha1:c70bc338e9a35b45263c3c68913ad516e9e70d62</id>
<content type='text'>
More "config-based hooks".

* ab/config-based-hooks-2:
  run-command: remove old run_hook_{le,ve}() hook API
  receive-pack: convert push-to-checkout hook to hook.h
  read-cache: convert post-index-change to use hook.h
  commit: convert {pre-commit,prepare-commit-msg} hook to hook.h
  git-p4: use 'git hook' to run hooks
  send-email: use 'git hook run' for 'sendemail-validate'
  git hook run: add an --ignore-missing flag
  hooks: convert worktree 'post-checkout' hook to hook library
  hooks: convert non-worktree 'post-checkout' hook to hook library
  merge: convert post-merge to use hook.h
  am: convert applypatch-msg to use hook.h
  rebase: convert pre-rebase to use hook.h
  hook API: add a run_hooks_l() wrapper
  am: convert {pre,post}-applypatch to use hook.h
  gc: use hook library for pre-auto-gc hook
  hook API: add a run_hooks() wrapper
  hook: add 'run' subcommand
</content>
</entry>
<entry>
<title>Merge branch 'jh/p4-spawning-external-commands-cleanup'</title>
<updated>2022-02-05T17:42:30Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2022-02-05T17:42:29Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=391d85d78db0b32712ab577fa701cc2856622e7e'/>
<id>urn:sha1:391d85d78db0b32712ab577fa701cc2856622e7e</id>
<content type='text'>
* jh/p4-spawning-external-commands-cleanup:
  git-p4: don't print shell commands as python lists
  git-p4: pass command arguments as lists instead of using shell
  git-p4: don't select shell mode using the type of the command argument
</content>
</entry>
<entry>
<title>Merge branch 'jh/p4-fix-use-of-process-error-exception'</title>
<updated>2022-02-05T17:42:29Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2022-02-05T17:42:29Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=8b9c425629d738f48c65da9307fb91147c2ca3f4'/>
<id>urn:sha1:8b9c425629d738f48c65da9307fb91147c2ca3f4</id>
<content type='text'>
* jh/p4-fix-use-of-process-error-exception:
  git-p4: fix instantiation of CalledProcessError
</content>
</entry>
<entry>
<title>Merge branch 'jh/p4-remove-unused'</title>
<updated>2022-01-10T19:52:50Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2022-01-10T19:52:50Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=9dbb375f94091279e0c9f52f0a3b559a60244da4'/>
<id>urn:sha1:9dbb375f94091279e0c9f52f0a3b559a60244da4</id>
<content type='text'>
Remove a few commands from "git p4" that aren't very useful.

* jh/p4-remove-unused:
  git-p4: remove "rollback" verb
  git-p4: remove "debug" verb
</content>
</entry>
<entry>
<title>Merge branch 'jh/p4-human-unit-numbers'</title>
<updated>2022-01-10T19:52:49Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2022-01-10T19:52:49Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=66f6c18e5b8706f07a9a8cbd06942d4c7835f7d7'/>
<id>urn:sha1:66f6c18e5b8706f07a9a8cbd06942d4c7835f7d7</id>
<content type='text'>
The way "git p4" shows file sizes in its output has been updated to
use human-readable units.

* jh/p4-human-unit-numbers:
  git-p4: show progress as an integer
  git-p4: print size values in appropriate units
</content>
</entry>
<entry>
<title>git-p4: use 'git hook' to run hooks</title>
<updated>2022-01-07T23:19:35Z</updated>
<author>
<name>Emily Shaffer</name>
<email>emilyshaffer@google.com</email>
</author>
<published>2021-12-22T03:59:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=0c8ac06b53cf048dc5aae6f31123e93b62af7cfc'/>
<id>urn:sha1:0c8ac06b53cf048dc5aae6f31123e93b62af7cfc</id>
<content type='text'>
Instead of duplicating the behavior of run-command.h:run_hook_le() in
Python, we can directly call 'git hook run'. We emulate the existence
check with the --ignore-missing flag.

We're dropping the "verbose" handling added in 9f59ca4d6af (git-p4:
create new function run_git_hook, 2020-02-11), those who want
diagnostic output about how hooks are run are now able to get that via
e.g. the trace2 facility and GIT_TRACE=1.

Signed-off-by: Emily Shaffer &lt;emilyshaffer@google.com&gt;
Signed-off-by: Ævar Arnfjörð Bjarmason &lt;avarab@gmail.com&gt;
Acked-by: Emily Shaffer &lt;emilyshaffer@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>git-p4: fix instantiation of CalledProcessError</title>
<updated>2022-01-06T23:05:22Z</updated>
<author>
<name>Joel Holdsworth</name>
<email>jholdsworth@nvidia.com</email>
</author>
<published>2022-01-06T21:41:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=40e7cfdd46eb14e63ae4238e3a067d955de54a3d'/>
<id>urn:sha1:40e7cfdd46eb14e63ae4238e3a067d955de54a3d</id>
<content type='text'>
CalledProcessError is an exception class from the subprocess namespace.
When raising this exception, git-p4 would instantiate CalledProcessError
objects without properly referencing the subprocess namespace causing
the script to fail.

Resolves the issue by replacing CalledProcessError with
subprocess.CalledProcessError.

Signed-off-by: Joel Holdsworth &lt;jholdsworth@nvidia.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>git-p4: don't print shell commands as python lists</title>
<updated>2022-01-06T22:55:12Z</updated>
<author>
<name>Joel Holdsworth</name>
<email>jholdsworth@nvidia.com</email>
</author>
<published>2022-01-06T21:40:35Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=727e6ea3506c36c3dd871bd8ef259bcbf7ba6be4'/>
<id>urn:sha1:727e6ea3506c36c3dd871bd8ef259bcbf7ba6be4</id>
<content type='text'>
Previously the git-p4 script would log commands as stringified
representations of the command parameter, leading to output such as
this:

Reading pipe: ['git', 'config', '--bool', 'git-p4.useclientspec']

Now that all commands are list objects, this patch instead joins the
elements of the list into a single string so the output now looks more
readable:

Reading pipe: git config --bool git-p4.useclientspec

Signed-off-by: Joel Holdsworth &lt;jholdsworth@nvidia.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>git-p4: pass command arguments as lists instead of using shell</title>
<updated>2022-01-06T22:55:12Z</updated>
<author>
<name>Joel Holdsworth</name>
<email>jholdsworth@nvidia.com</email>
</author>
<published>2022-01-06T21:40:34Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=8a470599f340e2e2bcf96f0b267199de321edef2'/>
<id>urn:sha1:8a470599f340e2e2bcf96f0b267199de321edef2</id>
<content type='text'>
In the majority of the subprocess calls where shell=True was used, it
was only needed to parse command arguments by spaces. In each of these
cases, the commands are now being passed in as lists instead of strings.

This change aids the comprehensibility of the code. Constucting commands
and arguments using strings risks bugs from unsanitized inputs, and the
attendant complexity of properly quoting and escaping command arguments.

Signed-off-by: Joel Holdsworth &lt;jholdsworth@nvidia.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>git-p4: don't select shell mode using the type of the command argument</title>
<updated>2022-01-06T22:55:12Z</updated>
<author>
<name>Joel Holdsworth</name>
<email>jholdsworth@nvidia.com</email>
</author>
<published>2022-01-06T21:40:33Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3d8a3038bce2b13faeca0b776efa896d1c0d0b49'/>
<id>urn:sha1:3d8a3038bce2b13faeca0b776efa896d1c0d0b49</id>
<content type='text'>
Previously, the script would invoke subprocess functions setting the
shell argument True if the command argument was a string, setting it
False otherwise.

This patch replaces this implicit type-driven behaviour with explicit
shell arguments specified by the caller.

The apparent motive for the implict behaviour is that the subprocess
functions do not divide command strings into args. Invoking
subprocess.call("echo hello") will attempt to execute a program by the
name "echo hello". With subprocess.call("echo hello", shell=True), sh
-c "echo hello" will be executed instead, which will cause the command
and args to be divided by spaces.

Eventually, all usage of shell=True, that is not necessary for some
purpose beyond parsing command strings, should be removed. For now,
this patch makes the usage of shells explicit.

Signed-off-by: Joel Holdsworth &lt;jholdsworth@nvidia.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
