payu-org / payu

A workflow management tool for numerical models on the NCI computing systems
Apache License 2.0
19 stars 26 forks source link

GitHub integration error #133

Closed navidcy closed 5 years ago

navidcy commented 5 years ago

I did

git clone layer2_tau1e-1_manyshortridges layer2_tau6e-1_manyshortridges
cd newfolder

various changes

git commit -am"new setup"
payu ghsetup
git push

and I get this:

[nc3020@raijin2 layer2_tau6e-1_manyshortridges]$ git commit la2* -am"run for 30 years"; git push;
fatal: Paths with -a does not make sense.
Counting objects: 7, done.
Delta compression using up to 32 threads.
Compressing objects: 100% (7/7), done.
Writing objects: 100% (7/7), 701 bytes | 0 bytes/s, done.
Total 7 (delta 5), reused 0 (delta 0)
remote: error: refusing to update checked out branch: refs/heads/master
remote: error: By default, updating the current branch in a non-bare repository
remote: error: is denied, because it will make the index and work tree inconsistent
remote: error: with what you pushed, and will require 'git reset --hard' to match
remote: error: the work tree to HEAD.
remote: error:
remote: error: You can set 'receive.denyCurrentBranch' configuration variable to
remote: error: 'ignore' or 'warn' in the remote repository to allow pushing into
remote: error: its current branch; however, this is not recommended unless you
remote: error: arranged to update its work tree to match what you pushed in some
remote: error: other way.
remote: error:
remote: error: To squelch this message and still keep the default behaviour, set
remote: error: 'receive.denyCurrentBranch' configuration variable to 'refuse'.
To /home/552/nc3020/SOchanBcBtEddySat/layer2/layer2_tau1e-1_manyshortridges
 ! [remote rejected] master -> master (branch is currently checked out)
error: failed to push some refs to '/home/552/nc3020/SOchanBcBtEddySat/layer2/layer2_tau1e-1_manyshortridges'
[nc3020@raijin2 layer2_tau6e-1_manyshortridges]$ git push
Counting objects: 7, done.
Delta compression using up to 32 threads.
Compressing objects: 100% (7/7), done.
Writing objects: 100% (7/7), 701 bytes | 0 bytes/s, done.
Total 7 (delta 5), reused 0 (delta 0)
remote: error: refusing to update checked out branch: refs/heads/master
remote: error: By default, updating the current branch in a non-bare repository
remote: error: is denied, because it will make the index and work tree inconsistent
remote: error: with what you pushed, and will require 'git reset --hard' to match
remote: error: the work tree to HEAD.
remote: error:
remote: error: You can set 'receive.denyCurrentBranch' configuration variable to
remote: error: 'ignore' or 'warn' in the remote repository to allow pushing into
remote: error: its current branch; however, this is not recommended unless you
remote: error: arranged to update its work tree to match what you pushed in some
remote: error: other way.
remote: error:
remote: error: To squelch this message and still keep the default behaviour, set
remote: error: 'receive.denyCurrentBranch' configuration variable to 'refuse'.
To /home/552/nc3020/SOchanBcBtEddySat/layer2/layer2_tau1e-1_manyshortridges
 ! [remote rejected] master -> master (branch is currently checked out)
error: failed to push some refs to '/home/552/nc3020/SOchanBcBtEddySat/layer2/layer2_tau1e-1_manyshortridges'
[nc3020@raijin2 layer2_tau6e-1_manyshortridges]$ git commit la2* -m"run for 30 years"; git push;
[master 608a040] run for 30 years
 2 files changed, 1098 insertions(+)
 create mode 100644 la2_t6e-1ms.e1500038
 create mode 100644 la2_t6e-1ms.o1500038
Counting objects: 11, done.
Delta compression using up to 32 threads.
Compressing objects: 100% (11/11), done.
Writing objects: 100% (11/11), 4.95 KiB | 0 bytes/s, done.
Total 11 (delta 6), reused 0 (delta 0)
remote: error: refusing to update checked out branch: refs/heads/master
remote: error: By default, updating the current branch in a non-bare repository
remote: error: is denied, because it will make the index and work tree inconsistent
remote: error: with what you pushed, and will require 'git reset --hard' to match
remote: error: the work tree to HEAD.
remote: error:
remote: error: You can set 'receive.denyCurrentBranch' configuration variable to
remote: error: 'ignore' or 'warn' in the remote repository to allow pushing into
remote: error: its current branch; however, this is not recommended unless you
remote: error: arranged to update its work tree to match what you pushed in some
remote: error: other way.
remote: error:
remote: error: To squelch this message and still keep the default behaviour, set
remote: error: 'receive.denyCurrentBranch' configuration variable to 'refuse'.
To /home/552/nc3020/SOchanBcBtEddySat/layer2/layer2_tau1e-1_manyshortridges
 ! [remote rejected] master -> master (branch is currently checked out)
error: failed to push some refs to '/home/552/nc3020/SOchanBcBtEddySat/layer2/layer2_tau1e-1_manyshortridges'

Any ideas?

And now I can't even commit to GitHub the "usual" way? Or can I?

marshallward commented 5 years ago

Best guess is that the glob in `git commit la2 -am"..."picked up something unexpected here. (Actually, I'm not even sure that's a validgit commit`).

This error also does not bode well

fatal: Paths with -a does not make sense.

Is this just a bad commit throwing git into a spiral?

Maybe re-try as separate steps rather than one line.

navidcy commented 5 years ago

I did that previously and got the same error.

On Oct 24, 2018, at 11:05, Marshall Ward notifications@github.com wrote:

Best guess is that the glob in git commit la2 -am"..." picked up something unexpected here. (Actually, I'm not even sure that's a valid git commit).

This error also does not bode well

fatal: Paths with -a does not make sense. Is this just a bad commit throwing git into a spiral?

Maybe re-try as separate steps rather than one line.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

marshallward commented 5 years ago

I think there might be some role of payu here, but I think the underlying problem is that git commit la2* -am"..." is not a valid git command. If I do git help commit then I can see no use case where something like la2* is supposed to precede a flag. Are you sure this is what you mean to do here?

If you want to just try git commit -am"some msg" without the glob and see what happens?

Even if this does explain the problem, there might be room for payu to be more resilient to this problem.

navidcy commented 5 years ago

my bad: I actually did git commit la2* -m"run for 30 years"; git push; N

On Oct 24, 2018, at 2:01 PM, Marshall Ward notifications@github.com wrote:

I think there might be some role of payu here, but I think the underlying problem is that git commit la2 -am"..." is not a valid git command. If I do git help commit then I can see no use case where something like la2 is supposed to precede a flag. Are you sure this is what you mean to do here?

If you want to just try git commit -am"some msg" without the glob and see what happens?

Even if this does explain the problem, there might be room for payu to be more resilient to this problem.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/marshallward/payu/issues/133#issuecomment-432495185, or mute the thread https://github.com/notifications/unsubscribe-auth/AGyIQKlGab82dLaX03MNwz0rA3UNKCBIks5un9fvgaJpZM4X1OKW.

AndyHoggANU commented 5 years ago

Hi @marshallward -- I'm also having a but of trouble with this aspect of payu. I can commit OK, but I get this error:


amh157@raijin3:025deg_jra55_iaf_pipes %% payu ghsetup
Traceback (most recent call last):
 File "/apps/payu/0.10/bin/payu", line 8, in <module>
   cli.parse()
 File "/apps/payu/0.10/lib/payu/cli.py", line 61, in parse
   run_cmd(**args)
 File "/apps/payu/0.10/lib/payu/subcommands/ghsetup_cmd.py", line 24, in runcmd
   runlog.github_setup()
 File "/apps/payu/0.10/lib/payu/runlog.py", line 118, in github_setup
   github_auth = self.authenticate()
 File "/apps/payu/0.10/lib/payu/runlog.py", line 247, in authenticate
   github_username = runlog_config.get('username')
AttributeError: 'list' object has no attribute 'get'
amh157@raijin3:025deg_jra55_iaf_pipes %%```
marshallward commented 5 years ago

I think that's a bug that Paul found. It's been fixed in master but not 0.10.

If you delete the runlog: True entry then it should be ok.

navidcy commented 5 years ago

1) what/where is the runlog: True entry? 2) why don't you release a 0.10.1 then with the bug fixed?

marshallward commented 5 years ago
  1. runlog: True would be in config.yaml
  2. Because this particular problem is avoidable, and I'm in the middle of a much more delicate update, and would rather focus on that than on minor updates.

If you want to use the latest version, you can try to do a python setup.py install --user, although that is what I am currently testing.

marshallward commented 5 years ago

I think this was resolved as "git command broke the runlog". With a special guest issue from Andy that will be fixed in the next release.

There's a broader discussion of how to handle stray git commands, but those are being discussed in #135.