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 stork script resilient to un-initialized git #27578

Open
GiudGiud opened this issue May 8, 2024 · 1 comment
Open

Make stork script resilient to un-initialized git #27578

GiudGiud opened this issue May 8, 2024 · 1 comment

Comments

@GiudGiud
Copy link
Contributor

GiudGiud commented May 8, 2024

Problem

In the babbler folder created by using the command `./moose/scripts/stork.sh Babbler'.

I try to build a new application, it's still the same.

(moose) kimi@DESKTOP-7APSM1S:~/projects$ ./moose/scripts/stork.sh Abc
Initialized empty Git repository in /home/kimi/projects/abc/.git/

*** Please tell me who you are.

Run

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

to set your account's default identity.
Omit --global to set the identity only in this repository.

fatal: empty ident name (for <kimi@DESKTOP-7APSM1S.localdomain>) not allowed
MOOSE app created in '/home/kimi/projects/abc'

To store your changes on GitHub:
    1. Log in to your GitHub account
    2. Create a new repository named 'abc'
    3. In this terminal window, run the following commands:
         cd /home/kimi/projects/abc
         git remote add origin https://github.com/YourGitHubUserName/abc
         git commit -m "Initial code commit"
         git push -u origin main

To automatically enforce MOOSE C++ code style in your commits, run:

    cd /home/kimi/projects/abc
    ./scripts/install-format-hook.sh

To enable software quality assurance (SQA) documentation using MooseDocs, perform the
following steps after adding your git repository remote:

    1. Navigate to /home/kimi/projects/abc/doc
    2. Run './moosedocs.py init sqa --app 'Abc' --category abc'
    3. Commit the initial SQA changes using the following commands:
         git add /home/kimi/projects/abc/doc
         git commit -m "Initial SQA changes"
         git push origin main
    4. Add new SQA content to the forms in /home/kimi/projects/abc/doc/content/sqa

For general assistance in MOOSE-based application SQA, please contact the MOOSE
framework development team. For further info on the MooseDocs code documentation
system, please visit https://mooseframework.inl.gov.
(moose) kimi@DESKTOP-7APSM1S:~/projects$ cd abc/
(moose) kimi@DESKTOP-7APSM1S:~/projects/abc$ make -j6
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/kimi/projects/moose/framework/../scripts/premake.py", line 183, in <module>
    PreMake().check()
  File "/home/kimi/projects/moose/framework/../scripts/premake.py", line 18, in __init__
    self.versioner_meta = Versioner().version_meta()
  File "/home/kimi/projects/moose/scripts/versioner.py", line 302, in version_meta
    app_name, _, app_hash = self.get_app()
  File "/home/kimi/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/kimi/miniforge/envs/moose/lib/python3.10/subprocess.py", line 421, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "/home/kimi/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/kimi/projects/moose/framework/moose.mk:388: prebuild] Error 1 (ignored)

Originally posted by @Always-kimi in #27575 (reply in thread)

How to reproduce

clean machine, no git activity yet, create a new app

Impact

confused users

@GiudGiud
Copy link
Contributor Author

Adding this item
#27612

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant