batchfetch 1.0.2__tar.gz → 1.0.4__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.
Files changed (21) hide show
  1. {batchfetch-1.0.2/batchfetch.egg-info → batchfetch-1.0.4}/PKG-INFO +16 -6
  2. {batchfetch-1.0.2 → batchfetch-1.0.4}/README.md +15 -5
  3. {batchfetch-1.0.2 → batchfetch-1.0.4}/batchfetch/batchfetch_base.py +1 -1
  4. {batchfetch-1.0.2 → batchfetch-1.0.4}/batchfetch/batchfetch_cli.py +4 -4
  5. {batchfetch-1.0.2 → batchfetch-1.0.4}/batchfetch/batchfetch_git.py +27 -7
  6. {batchfetch-1.0.2 → batchfetch-1.0.4/batchfetch.egg-info}/PKG-INFO +16 -6
  7. {batchfetch-1.0.2 → batchfetch-1.0.4}/setup.py +1 -1
  8. {batchfetch-1.0.2 → batchfetch-1.0.4}/.gitignore +0 -0
  9. {batchfetch-1.0.2 → batchfetch-1.0.4}/LICENSE +0 -0
  10. {batchfetch-1.0.2 → batchfetch-1.0.4}/batchfetch/__init__.py +0 -0
  11. {batchfetch-1.0.2 → batchfetch-1.0.4}/batchfetch/helpers.py +0 -0
  12. {batchfetch-1.0.2 → batchfetch-1.0.4}/batchfetch.egg-info/SOURCES.txt +0 -0
  13. {batchfetch-1.0.2 → batchfetch-1.0.4}/batchfetch.egg-info/dependency_links.txt +0 -0
  14. {batchfetch-1.0.2 → batchfetch-1.0.4}/batchfetch.egg-info/entry_points.txt +0 -0
  15. {batchfetch-1.0.2 → batchfetch-1.0.4}/batchfetch.egg-info/requires.txt +0 -0
  16. {batchfetch-1.0.2 → batchfetch-1.0.4}/batchfetch.egg-info/top_level.txt +0 -0
  17. {batchfetch-1.0.2 → batchfetch-1.0.4}/run_tests.sh +0 -0
  18. {batchfetch-1.0.2 → batchfetch-1.0.4}/setup.cfg +0 -0
  19. {batchfetch-1.0.2 → batchfetch-1.0.4}/tests/data/test-md5sum.txt +0 -0
  20. {batchfetch-1.0.2 → batchfetch-1.0.4}/tests/data/test-run_simple.sh +0 -0
  21. {batchfetch-1.0.2 → batchfetch-1.0.4}/tests/test_helpers.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: batchfetch
3
- Version: 1.0.2
3
+ Version: 1.0.4
4
4
  Summary: Efficiently clone and pull multiple Git repositories.
5
5
  Home-page: https://github.com/jamescherti/batchfetch
6
6
  Author: James Cherti
@@ -22,11 +22,21 @@ Requires-Dist: schema
22
22
  Requires-Dist: setproctitle
23
23
  Requires-Dist: PyYAML
24
24
 
25
- # Batchfetch - Efficiently clone or pull multiple Git repositories.
25
+ # Batchfetch - Efficiently clone or pull multiple Git repositories in parallel
26
26
 
27
27
  ## Introduction
28
28
 
29
- Efficiently clone or pull multiple Git repositories in parallel. Ideal for developers managing multiple projects or for downloading plugins or packages in bulk.
29
+ Batchfetch is a command-line tool designed to clone, fetch, and merge multiple Git repositories simultaneously.
30
+
31
+ With Batchfetch, you no longer need to manually manage each repository one by one. It automates the tedious aspects of repository management, freeing you up to focus on what truly matters: your workflow.
32
+
33
+ Batchfetch is ideal for quickly cloning or pulling multiple Git repositories. It is also useful for cloning various addons, such as Vim plugins, Emacs packages, Ansible roles, Ansible collections, and other addons available on websites like GitHub, Codeberg, and GitLab.
34
+
35
+ ## Features:
36
+ - Git Clone and Fetch/Merge: Clones the repositories and their submodules, ensuring that all the repositories are always up-to-date by fetching and merging changes.
37
+ - Parallel Operations: Utilizes threads to simultaneously Git clone or pull multiple repositories, dramatically reducing wait times.
38
+ - User-Friendly Interface: Provides simple and straightforward command-line options that make it easy to get started and effectively manage your repositories.
39
+ - Custom Configuration: Allows the use of a YAML configuration file to specify and manage the repositories you interact with, enabling repeatable setups and consistent environments.
30
40
 
31
41
  ## Installation
32
42
 
@@ -69,15 +79,15 @@ Execute the `batchfetch` command from the same directory as `batchfetch.yml` to
69
79
 
70
80
  Here are the various options that `batchfetch` provides, along with descriptions of their usage:
71
81
 
72
- ```sh
82
+ ```
73
83
  usage: batchfetch [--option] [args]
74
84
 
75
85
  Command line interface.
76
86
 
77
87
  options:
78
88
  -h, --help show this help message and exit
79
- -p MAX_PROCS, --max-procs MAX_PROCS
80
- Run up to N Number of parallel git processes (Default: 3).
89
+ -j JOBS, --jobs JOBS
90
+ Run up to N Number of parallel git processes (Default: 5).
81
91
  -v, --verbose Enable verbose mode.
82
92
  -f BATCHFETCH_FILE, --batchfetch-file BATCHFETCH_FILE
83
93
  Specify the batchfetch YAML file (default: './batchfetch.yaml').
@@ -1,8 +1,18 @@
1
- # Batchfetch - Efficiently clone or pull multiple Git repositories.
1
+ # Batchfetch - Efficiently clone or pull multiple Git repositories in parallel
2
2
 
3
3
  ## Introduction
4
4
 
5
- Efficiently clone or pull multiple Git repositories in parallel. Ideal for developers managing multiple projects or for downloading plugins or packages in bulk.
5
+ Batchfetch is a command-line tool designed to clone, fetch, and merge multiple Git repositories simultaneously.
6
+
7
+ With Batchfetch, you no longer need to manually manage each repository one by one. It automates the tedious aspects of repository management, freeing you up to focus on what truly matters: your workflow.
8
+
9
+ Batchfetch is ideal for quickly cloning or pulling multiple Git repositories. It is also useful for cloning various addons, such as Vim plugins, Emacs packages, Ansible roles, Ansible collections, and other addons available on websites like GitHub, Codeberg, and GitLab.
10
+
11
+ ## Features:
12
+ - Git Clone and Fetch/Merge: Clones the repositories and their submodules, ensuring that all the repositories are always up-to-date by fetching and merging changes.
13
+ - Parallel Operations: Utilizes threads to simultaneously Git clone or pull multiple repositories, dramatically reducing wait times.
14
+ - User-Friendly Interface: Provides simple and straightforward command-line options that make it easy to get started and effectively manage your repositories.
15
+ - Custom Configuration: Allows the use of a YAML configuration file to specify and manage the repositories you interact with, enabling repeatable setups and consistent environments.
6
16
 
7
17
  ## Installation
8
18
 
@@ -45,15 +55,15 @@ Execute the `batchfetch` command from the same directory as `batchfetch.yml` to
45
55
 
46
56
  Here are the various options that `batchfetch` provides, along with descriptions of their usage:
47
57
 
48
- ```sh
58
+ ```
49
59
  usage: batchfetch [--option] [args]
50
60
 
51
61
  Command line interface.
52
62
 
53
63
  options:
54
64
  -h, --help show this help message and exit
55
- -p MAX_PROCS, --max-procs MAX_PROCS
56
- Run up to N Number of parallel git processes (Default: 3).
65
+ -j JOBS, --jobs JOBS
66
+ Run up to N Number of parallel git processes (Default: 5).
57
67
  -v, --verbose Enable verbose mode.
58
68
  -f BATCHFETCH_FILE, --batchfetch-file BATCHFETCH_FILE
59
69
  Specify the batchfetch YAML file (default: './batchfetch.yaml').
@@ -113,7 +113,7 @@ class BatchFetchBase:
113
113
 
114
114
  if not stdout.endswith("\n"):
115
115
  stdout += "\n"
116
- self.add_output((" " * self.indent) + stdout)
116
+ self.add_output(stdout)
117
117
 
118
118
  def _run_pre_exec(self, cwd: os.PathLike = Path(".")):
119
119
  self._initialize_data()
@@ -184,7 +184,7 @@ class BatchFetchCli:
184
184
  else:
185
185
  if num_success == 0:
186
186
  print("Already up to date.")
187
- else:
187
+ elif not self.verbose:
188
188
  print("Success.")
189
189
 
190
190
  return True
@@ -205,8 +205,8 @@ def parse_args():
205
205
  parser = argparse.ArgumentParser(description=desc, usage=usage)
206
206
 
207
207
  parser.add_argument(
208
- "-p", "--max-procs", default="3", required=False,
209
- help="Run up to N Number of parallel git processes (Default: 3).",
208
+ "-j", "--jobs", default="5", required=False,
209
+ help="Run up to N Number of parallel git processes (Default: 5).",
210
210
  )
211
211
 
212
212
  parser.add_argument(
@@ -244,7 +244,7 @@ def command_line_interface():
244
244
 
245
245
  args = parse_args()
246
246
  downloader_cli = BatchFetchCli(verbose=args.verbose,
247
- max_workers=int(args.max_procs))
247
+ max_workers=int(args.jobs))
248
248
 
249
249
  downloader_cli.load(args.batchfetch_file)
250
250
  os.chdir(os.path.dirname(args.batchfetch_file))
@@ -209,16 +209,19 @@ class BatchFetchGit(BatchFetchBase):
209
209
  try:
210
210
  self._git_tags(self["branch"])
211
211
  except GitBranchDoesNotExist:
212
- ignore_git_pull = False
212
+ pass
213
213
  else:
214
214
  # The branch exists
215
- ignore_git_pull = True
216
215
 
217
- # Check if the new branch is different from the current one
218
- commit_ref = self._git_ref(cwd=self.git_local_dir)
219
- if self.current_branch and (commit_ref == self["branch"] or
220
- self.current_branch == self["branch"]):
221
- ignore_git_pull = True
216
+ # Ignore Git pull when the git reference is the same
217
+ commit_ref = self._git_ref(cwd=self.git_local_dir)
218
+ if (self.current_branch and
219
+ (commit_ref == self["branch"] or
220
+ self.current_branch == self["branch"])):
221
+ ignore_git_pull = True
222
+ # Ignore Git pull if it is not a local branch
223
+ elif not self._git_is_local_branch(self["branch"]):
224
+ ignore_git_pull = True
222
225
 
223
226
  if ignore_git_pull:
224
227
  self.add_output(self.indent_spaces +
@@ -244,6 +247,23 @@ class BatchFetchGit(BatchFetchBase):
244
247
 
245
248
  return git_merge
246
249
 
250
+ def _git_is_local_branch(self, branch: str) -> bool:
251
+ try:
252
+ stdout, _ = run_simple(["git", "rev-parse", "--symbolic-full-name",
253
+ branch], env=self.env,
254
+ cwd=self.git_local_dir)
255
+ if not stdout:
256
+ return False
257
+
258
+ full_branch_name = stdout[0].strip()
259
+
260
+ if full_branch_name.startswith("refs/heads/"):
261
+ return True
262
+ except subprocess.CalledProcessError:
263
+ pass
264
+
265
+ return False
266
+
247
267
  def _git_tags(self, branch: str) -> List[str]:
248
268
  stdout: List[str] = []
249
269
  try:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: batchfetch
3
- Version: 1.0.2
3
+ Version: 1.0.4
4
4
  Summary: Efficiently clone and pull multiple Git repositories.
5
5
  Home-page: https://github.com/jamescherti/batchfetch
6
6
  Author: James Cherti
@@ -22,11 +22,21 @@ Requires-Dist: schema
22
22
  Requires-Dist: setproctitle
23
23
  Requires-Dist: PyYAML
24
24
 
25
- # Batchfetch - Efficiently clone or pull multiple Git repositories.
25
+ # Batchfetch - Efficiently clone or pull multiple Git repositories in parallel
26
26
 
27
27
  ## Introduction
28
28
 
29
- Efficiently clone or pull multiple Git repositories in parallel. Ideal for developers managing multiple projects or for downloading plugins or packages in bulk.
29
+ Batchfetch is a command-line tool designed to clone, fetch, and merge multiple Git repositories simultaneously.
30
+
31
+ With Batchfetch, you no longer need to manually manage each repository one by one. It automates the tedious aspects of repository management, freeing you up to focus on what truly matters: your workflow.
32
+
33
+ Batchfetch is ideal for quickly cloning or pulling multiple Git repositories. It is also useful for cloning various addons, such as Vim plugins, Emacs packages, Ansible roles, Ansible collections, and other addons available on websites like GitHub, Codeberg, and GitLab.
34
+
35
+ ## Features:
36
+ - Git Clone and Fetch/Merge: Clones the repositories and their submodules, ensuring that all the repositories are always up-to-date by fetching and merging changes.
37
+ - Parallel Operations: Utilizes threads to simultaneously Git clone or pull multiple repositories, dramatically reducing wait times.
38
+ - User-Friendly Interface: Provides simple and straightforward command-line options that make it easy to get started and effectively manage your repositories.
39
+ - Custom Configuration: Allows the use of a YAML configuration file to specify and manage the repositories you interact with, enabling repeatable setups and consistent environments.
30
40
 
31
41
  ## Installation
32
42
 
@@ -69,15 +79,15 @@ Execute the `batchfetch` command from the same directory as `batchfetch.yml` to
69
79
 
70
80
  Here are the various options that `batchfetch` provides, along with descriptions of their usage:
71
81
 
72
- ```sh
82
+ ```
73
83
  usage: batchfetch [--option] [args]
74
84
 
75
85
  Command line interface.
76
86
 
77
87
  options:
78
88
  -h, --help show this help message and exit
79
- -p MAX_PROCS, --max-procs MAX_PROCS
80
- Run up to N Number of parallel git processes (Default: 3).
89
+ -j JOBS, --jobs JOBS
90
+ Run up to N Number of parallel git processes (Default: 5).
81
91
  -v, --verbose Enable verbose mode.
82
92
  -f BATCHFETCH_FILE, --batchfetch-file BATCHFETCH_FILE
83
93
  Specify the batchfetch YAML file (default: './batchfetch.yaml').
@@ -22,7 +22,7 @@ from setuptools import find_packages, setup
22
22
 
23
23
  setup(
24
24
  name="batchfetch",
25
- version="1.0.2",
25
+ version="1.0.4",
26
26
  packages=find_packages(),
27
27
  description="Efficiently clone and pull multiple Git repositories.",
28
28
  license="GPLv3",
File without changes
File without changes
File without changes
File without changes