Skip to content

Commit

Permalink
prereqs
Browse files Browse the repository at this point in the history
  • Loading branch information
scivision committed Mar 29, 2019
1 parent b25009a commit 9b36d48
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 40 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Expand Up @@ -20,4 +20,6 @@ matrix:
- pytest --cov
- coveralls

install: pip install -e .[tests]

script: pytest -v
5 changes: 2 additions & 3 deletions README.md
Expand Up @@ -48,12 +48,11 @@ python -m pip install -e .
I didn't know of any other easy ways to do these Git tasks:

* `gitbranch` Tells of any non-master branches under directory ~/code
* `git_filemode_windows` Sets all git repos to don't care permissions under directory ~/code
* `gitemail` list all contributor email addresses. Optionally, amend email addresses for prior Git commits

### Sync large number of git repos

These assume numerous subdirectories under `~/code` or `c:\code`.
These assume numerous subdirectories under `~/code` or `c:\code`.
They work very quickly for large numbers (100+) repos.


Expand All @@ -67,7 +66,7 @@ You can place an empty file `.nogit` in a subdirectory to skip it.

#### [optional] speedup with https pull
For public repos, to make the Git remote checking go at least twice as fast, and significantly reduce the computational burden when SSH is used for `git push` (as is recommended), consider the "pushInsteadOf" global Git config.
To do this, when cloning a public repo (including ones you're a collaborator on), use `git clone https://`.
To do this, when cloning a public repo (including ones you're a collaborator on), use `git clone https://`.
This global SSH push config one-time does SSH push for HTTPS-cloned repos:
```sh
git config --global url."ssh://github.com/".pushInsteadOf https://github.com/
Expand Down
27 changes: 0 additions & 27 deletions git_filemode_windows.py

This file was deleted.

7 changes: 1 addition & 6 deletions gitutils/branch.py
Expand Up @@ -6,13 +6,8 @@
from pathlib import Path
import asyncio
import logging
import shutil

from .git import baddir

GITEXE = shutil.which('git')
if not GITEXE:
raise FileNotFoundError('Could not find executable for Git')
from .git import baddir, GITEXE

CMD = [GITEXE, 'rev-parse', '--abbrev-ref', 'HEAD']

Expand Down
8 changes: 4 additions & 4 deletions gitutils/git.py
Expand Up @@ -21,10 +21,10 @@

"""
replaced by git status --porcelain:
['git','ls-files','-o','-d','--exclude-standard']): # check for uncommitted files
['git','--no-pager','diff','HEAD'], # check for uncommitted work
git ls-files -o -d --exclude-standard: # check for uncommitted files
git --no-pager diff HEAD , # check for uncommitted work
DOES NOT WORK ['git','log','--branches','--not','--remotes'], # check for uncommitted branches
DOES NOT WORK git log --branches --not --remotes # check for uncommitted branches
"""


Expand Down Expand Up @@ -94,7 +94,7 @@ def listchanged(path: Path) -> List[str]:
changes : list of str
filenames changed in this Git repo
"""
ret = subprocess.check_output(['git', 'ls-files', '--modified'],
ret = subprocess.check_output([GITEXE, 'ls-files', '--modified'],
universal_newlines=True,
cwd=path)

Expand Down

0 comments on commit 9b36d48

Please sign in to comment.