Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make build system resilient to missing first git commit OR make sure users make a commit in stork script #27631

Open
GiudGiud opened this issue May 15, 2024 Discussed in #27612 · 0 comments
Labels
C: Framework T: task An enhancement to the software.

Comments

@GiudGiud
Copy link
Contributor

Reason

See discussion
User who does not want to use git thought he could skip committing. But no because we use git in our build system, probably to check versions / create the version headers

Design

We could just add a git commit -am "First commit" in the stork script

Impact

Less user support

Discussed in #27612

Originally posted by Khaksarkn May 13, 2024

Check these boxes if you have followed the posting rules.

Question

Hi, I am getting this message when I want to make my application:

fatal: ambiguous argument 'HEAD': 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 "/home/kian/projects/moose/framework/../scripts/premake.py", line 183, in <module>
    PreMake().check()
  File "/home/kian/projects/moose/framework/../scripts/premake.py", line 18, in __init__
    self.versioner_meta = Versioner().version_meta()
  File "/home/kian/projects/moose/scripts/versioner.py", line 302, in version_meta
    app_name, _, app_hash = self.get_app()
  File "/home/kian/projects/moose/scripts/versioner.py", line 352, in get_app
    git_hash = subprocess.check_output(hash_command, encoding='utf-8').rstrip()[0:7]
  File "/home/kian/miniforge/envs/moose/lib/python3.10/subprocess.py", line 421, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "/home/kian/miniforge/envs/moose/lib/python3.10/subprocess.py", line 526, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['git', 'rev-parse', 'HEAD']' returned non-zero exit status 128.
make: [/home/kian/projects/moose/framework/moose.mk:388: prebuild] Error 1 (ignored)
Checking if header needs updating: /home/kian/projects/moose/framework/include/base/MooseRevision.h...

I saw this discussion about this: #27575
I ran

  git config --global user.email "you@example.com"
  git config --global user.name "Your Name"

with my credentials, but it does not go away.

I created the app (using stork), made it, and it worked. diffusion test passes. Then added some source code, got some errors, removed the files, then tried to make the app like it's new, I got this. I understand this is a git error but not sure why it's there. It didn't use to be an issue.
Also, I am not using git. I wrote all the codes not using git. I am not sure if the procedure has changed after the updates in the past year.
I would appreciate it if you could help me out.

@GiudGiud GiudGiud added C: Framework T: task An enhancement to the software. labels May 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: Framework T: task An enhancement to the software.
Projects
None yet
Development

No branches or pull requests

1 participant