floooh/fips

"fips diag" fails if repo has remote other than origin

gustavolsson opened this issue · 2 comments

I ran fips diag in sokol-samples with my own sokol branch checked out, at fork/android, and got the following error. fips assumes that the branch is on the origin remote.

...
=== local changes:
checking 'fips-glfw':
  no local changes
checking 'fips-libmodplug':
  no local changes
checking 'fips-imgui':
  no local changes
checking 'sokol':
fatal: ambiguous argument 'origin/android..android': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
Traceback (most recent call last):
  File "./fips", line 17, in <module>
    fips.run(fips_path, proj_path, sys.argv)
  File "/Users/gustav/Documents/Development/fips-workspace/fips/mod/fips.py", line 49, in run
    verb.verbs[verb_name].run(fips_path, proj_path, verb_args)
  File "/Users/gustav/Documents/Development/fips-workspace/fips/verbs/diag.py", line 91, in run
    check_local_changes(fips_dir, proj_dir)
  File "/Users/gustav/Documents/Development/fips-workspace/fips/verbs/diag.py", line 68, in check_local_changes
    dep.check_local_changes(fips_dir, proj_dir)
  File "/Users/gustav/Documents/Development/fips-workspace/fips/mod/dep.py", line 501, in check_local_changes
    if git.has_local_changes(imp_proj_dir) :
  File "/Users/gustav/Documents/Development/fips-workspace/fips/mod/tools/git.py", line 120, in has_local_changes
    cwd=proj_dir, shell=True).decode("utf-8")
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 573, in check_output
    raise CalledProcessError(retcode, cmd, output=output)
subprocess.CalledProcessError: Command 'git log origin/android..android --oneline' returned non-zero exit status 128

Yep, known issue, not sure yet what's the best way to fix (but I haven't spent time on potential solutions yet either).

Ok, I think I fixed this now, I'm running "git status -sb" which gives me the current local branch name, and the tracked remote/branch pair (if exists), and use that to check for differences.

This should fix both fips update and fips diag imports for such situations.

PS: fix is in commit 5576c09