git-rexec 1.0.1__tar.gz → 1.0.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,13 +1,12 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: git-rexec
3
- Version: 1.0.1
3
+ Version: 1.0.2
4
4
  Summary: Locate Git repositories and execute commands against them in parallel.
5
5
  Author: James Cherti
6
- License: GPL-3.0-or-later
6
+ License-Expression: GPL-3.0-or-later
7
7
  Project-URL: Homepage, https://github.com/jamescherti/git-rexec
8
8
  Keywords: git,parallel,executor,automation
9
9
  Classifier: Programming Language :: Python :: 3
10
- Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
11
10
  Classifier: Operating System :: OS Independent
12
11
  Classifier: Environment :: Console
13
12
  Classifier: Topic :: Software Development :: Version Control :: Git
@@ -48,6 +47,11 @@ Here are examples demonstrating how to use `git-rexec`:
48
47
  git-rexec --if-exec 'sh -c "test -f README.md"' --parallel -- wc -l README.md
49
48
  ```
50
49
 
50
+ - Print the paths of all discovered Git repositories:
51
+ ```bash
52
+ git-rexec --print
53
+ ```
54
+
51
55
  If this helps your workflow, please support the project by **⭐ starring git-rexec on GitHub** and sharing it on your website, blog, Mastodon, Reddit, X, LinkedIn, or other social media platforms to help more Git users discover its benefits.
52
56
 
53
57
  ## Features
@@ -57,6 +61,7 @@ If this helps your workflow, please support the project by **⭐ starring git-re
57
61
  - Execute shell commands across multiple repositories in parallel using worker threads.
58
62
  - Filter target repositories based on the exit code of a conditional check (`--if-exec`).
59
63
  - Exclude specific directories from the search path.
64
+ - Export discovered repository paths for integration with other shell tools (using `--print` or `--print0`).
60
65
 
61
66
  ## Installation
62
67
 
@@ -29,6 +29,11 @@ Here are examples demonstrating how to use `git-rexec`:
29
29
  git-rexec --if-exec 'sh -c "test -f README.md"' --parallel -- wc -l README.md
30
30
  ```
31
31
 
32
+ - Print the paths of all discovered Git repositories:
33
+ ```bash
34
+ git-rexec --print
35
+ ```
36
+
32
37
  If this helps your workflow, please support the project by **⭐ starring git-rexec on GitHub** and sharing it on your website, blog, Mastodon, Reddit, X, LinkedIn, or other social media platforms to help more Git users discover its benefits.
33
38
 
34
39
  ## Features
@@ -38,6 +43,7 @@ If this helps your workflow, please support the project by **⭐ starring git-re
38
43
  - Execute shell commands across multiple repositories in parallel using worker threads.
39
44
  - Filter target repositories based on the exit code of a conditional check (`--if-exec`).
40
45
  - Exclude specific directories from the search path.
46
+ - Export discovered repository paths for integration with other shell tools (using `--print` or `--print0`).
41
47
 
42
48
  ## Installation
43
49
 
@@ -6,7 +6,7 @@
6
6
  #
7
7
  # Author: James Cherti
8
8
  # URL: https://github.com/jamescherti/git-rexec
9
- # Version: 1.0.1
9
+ # Version: 1.0.2
10
10
  #
11
11
  # Copyright (C) 2019-2026 James Cherti
12
12
  #
@@ -125,6 +125,7 @@ def git_py_find_repo(root: Path) -> tuple[set[Path], set[Path]]:
125
125
 
126
126
  return repos, sub_repos
127
127
 
128
+
128
129
  def get_sub_repos(repo_path: Path) -> set[Path]:
129
130
  """Extract worktrees and submodules from a Git repository.
130
131
 
@@ -191,7 +192,6 @@ def get_sub_repos(repo_path: Path) -> set[Path]:
191
192
  return sub_repos
192
193
 
193
194
 
194
-
195
195
  def run_command_get_output(repo_path: Path, cmd_list: list[str],
196
196
  capture: bool = True) -> CommandResult:
197
197
  """Execute a shell command within a specific directory.
@@ -423,6 +423,19 @@ def parse_args() -> argparse.Namespace:
423
423
  help="Include sub-repositories (e.g., Git worktrees and submodules)",
424
424
  default=False
425
425
  )
426
+ parser.add_argument(
427
+ "--print",
428
+ action="store_true",
429
+ help="Print the paths (only when no command is provided)",
430
+ default=False
431
+ )
432
+ parser.add_argument(
433
+ "--print0",
434
+ action="store_true",
435
+ help=("Separate the paths with a null character (only when no "
436
+ "command is provided)"),
437
+ default=False
438
+ )
426
439
  parser.add_argument(
427
440
  "exec_cmd",
428
441
  type=str,
@@ -484,6 +497,11 @@ def main() -> None:
484
497
 
485
498
  args: argparse.Namespace = parse_args()
486
499
 
500
+ # Check for empty action
501
+ if not args.exec_cmd and not args.print and not args.print0:
502
+ print("Nothing to do.", file=sys.stderr)
503
+ sys.exit(0)
504
+
487
505
  # Verify that the execution command exists
488
506
  if args.exec_cmd and not shutil.which(args.exec_cmd[0]):
489
507
  print(
@@ -566,7 +584,10 @@ def main() -> None:
566
584
 
567
585
  # If no commands were run, just list the repo
568
586
  if not args.exec_cmd:
569
- print(repo_path)
587
+ if args.print0:
588
+ print(repo_path, end="\0")
589
+ elif args.print:
590
+ print(repo_path)
570
591
 
571
592
  # Final Error Summary
572
593
  sys.exit(print_error_summary(execution_errors))
@@ -1,13 +1,12 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: git-rexec
3
- Version: 1.0.1
3
+ Version: 1.0.2
4
4
  Summary: Locate Git repositories and execute commands against them in parallel.
5
5
  Author: James Cherti
6
- License: GPL-3.0-or-later
6
+ License-Expression: GPL-3.0-or-later
7
7
  Project-URL: Homepage, https://github.com/jamescherti/git-rexec
8
8
  Keywords: git,parallel,executor,automation
9
9
  Classifier: Programming Language :: Python :: 3
10
- Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
11
10
  Classifier: Operating System :: OS Independent
12
11
  Classifier: Environment :: Console
13
12
  Classifier: Topic :: Software Development :: Version Control :: Git
@@ -48,6 +47,11 @@ Here are examples demonstrating how to use `git-rexec`:
48
47
  git-rexec --if-exec 'sh -c "test -f README.md"' --parallel -- wc -l README.md
49
48
  ```
50
49
 
50
+ - Print the paths of all discovered Git repositories:
51
+ ```bash
52
+ git-rexec --print
53
+ ```
54
+
51
55
  If this helps your workflow, please support the project by **⭐ starring git-rexec on GitHub** and sharing it on your website, blog, Mastodon, Reddit, X, LinkedIn, or other social media platforms to help more Git users discover its benefits.
52
56
 
53
57
  ## Features
@@ -57,6 +61,7 @@ If this helps your workflow, please support the project by **⭐ starring git-re
57
61
  - Execute shell commands across multiple repositories in parallel using worker threads.
58
62
  - Filter target repositories based on the exit code of a conditional check (`--if-exec`).
59
63
  - Exclude specific directories from the search path.
64
+ - Export discovered repository paths for integration with other shell tools (using `--print` or `--print0`).
60
65
 
61
66
  ## Installation
62
67
 
@@ -4,18 +4,17 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "git-rexec"
7
- version = "1.0.1"
7
+ version = "1.0.2"
8
8
  description = "Locate Git repositories and execute commands against them in parallel."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.9"
11
- license = {text = "GPL-3.0-or-later"}
11
+ license = "GPL-3.0-or-later"
12
12
  authors = [
13
13
  {name = "James Cherti"}
14
14
  ]
15
15
  keywords = ["git", "parallel", "executor", "automation"]
16
16
  classifiers = [
17
17
  "Programming Language :: Python :: 3",
18
- "License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)",
19
18
  "Operating System :: OS Independent",
20
19
  "Environment :: Console",
21
20
  "Topic :: Software Development :: Version Control :: Git"
File without changes
File without changes