Skip to content

Commit

Permalink
git tracking messages cleaned up
Browse files Browse the repository at this point in the history
  • Loading branch information
perrette committed Apr 28, 2023
1 parent 6354ed6 commit 0285cf5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 0 additions & 4 deletions papers/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,6 @@ def _backup_bib(biblio, config, message=None):

message = message or f'back-up {config.bibtex} after command:\n\n papers ' +' '.join(sys.argv[1:])
res = config.gitcmd(f"commit -m '{message}'", check=False)
if res != 0:
logger.warning('Failed to commit')

config.gitcmd(f"clean -f") # will also clean future files

def _restore_from_backupdir(config):
Expand Down Expand Up @@ -354,7 +351,6 @@ def installcmd(parser, o, config):
if 'futures.txt' not in (l.strip() for l in lines):
f.write('futures.txt\n')
config.gitcmd('add .gitignore')
config.gitcmd('status',check=False)
config.gitcmd(f'add {os.path.abspath(config.file)}')
message = f'papers ' +' '.join(sys.argv[1:])
config.gitcmd(f'commit -m "new install: config file"', check=False)
Expand Down
4 changes: 2 additions & 2 deletions papers/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ def root(self):
else:
return Path(os.path.sep)

def gitcmd(self, cmd, check=True):
return (sp.check_call if check else sp.call)(f"git {cmd}", shell=True, cwd=self.gitdir)
def gitcmd(self, cmd, check=True, **kw):
return (sp.check_call if check else sp.call)(f"git {cmd}", shell=True, cwd=self.gitdir, **kw)


def _relpath(self, p):
Expand Down

0 comments on commit 0285cf5

Please sign in to comment.