-
Notifications
You must be signed in to change notification settings - Fork 358
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Use git rev-parse
in `justfile and other process
#2045
Comments
Thanks for creating the RFC issue 🙏 Is this true? I don't think so because we are supposed to be using ubuntu:22.04 images.
I'd like to know the concrete cases where the bug occurs with
|
Just to double check, we are referring to the github action ubuntu 22 image right? It actually has a bunch of things pre-installed, including
Consider the we have two justfiles. youki/justfile
# Either as individual justfile or `youki/justfile` calls `just -f crates/justfile XXX`.
youki/crates/justfile Inside the
If later, we want to move the In the end, this is not something that I have a lot of strong opinion on. I do think using |
Oops, sorry. I misunderstood something. You are right 🙏
Is this not good enough? root := {{ justfile_directory() }}/../ I have a problem with this, but from a readability point of view, I think it is difficult to understand what the result of this git command itself will be. |
Do you mean the git command
If you consider using relative path to be good enough, then I guess the argument is mute. From my perspective, using Also note, if we only have a single |
Of course I know because I was the first to introduce this command. But an outside contributor would not know what this command is for a moment. It is an unfamiliar subcommand.
What kind of case is it?
I am concerned that I cannot envision too many specific cases of error. How about something like this? If you actually encounter a problem, introduce git rev-parse. |
Sounds fair. |
@yihuaf Thanks for your understanding. |
@utam0k I want to continue the discussion from this PR here:
#2027 (comment)
Specifically, I am of the opinion that removing
git
from the build dependency, especially the use ofgit rev-parse
does not gain much for us.First, I believe that
git
is ubiquitous and a requisite to a lot of our development workflow already. In the case of github action,git
is definitely pre-installed and used to clone the repo. The only case I can think of where we have to installgit
is if we mount the source code into a container or vagrant vm to buildyouki
, but even in these case installing git is not a big deal.Second,
git
is already entrenched in the workflow.justfile
was only a part. From integration_test.sh to build.sh, usinggit
to locate the project root directory is common.Third,
git rev-parse
is the only effective way of locating the project root from anywhere inside the project, independent of the cwd. This is helpful that scripts and justfiles don't have to keep track of where the project roots are. The alternative is to either force users to calljustfile
from the root of the project or we use relative path to the{{ justfile_directory }}
. Using relative path can create trouble because../../
can be bug prone.Therefore, I would suggest us to keep using
git rev-parse
to obtain the project root wherever needed.The text was updated successfully, but these errors were encountered: