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
fetchgit: extraConfig, allowing extra git configuration. #49569
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems useful!
Any reason to not merge this? |
6ec12b7
to
7949fef
Compare
What is required for this to be merged? |
@puffnfresh Any thoughts on what it'll take to get this merged? |
@@ -20,6 +20,8 @@ in | |||
# successfully. This can do things like check or transform the file. | |||
postFetch ? "" | |||
, preferLocalBuild ? true | |||
, # Extra configuration appended to the repo's local configuration file. | |||
extraConfig ? "" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extraConfig
is a bit vague. Perhaps extraGitConfig
would be better?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also makes sense to put it above postFetch ? ""
.
@@ -207,6 +207,9 @@ clone(){ | |||
# Initialize the repository. | |||
init_remote "$url" | |||
|
|||
# Append extra config. | |||
echo "${extraConfig}" >> .git/config |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will break if extraConfig
contains special characters like "
. Perhaps a safer way is to write your string to a path in the store using builtins.toFile
and then use "cat" to read that file instead of trying to "echo" the string.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Scratch that. This is not inside nix, but just in the shell. You need to drop the curly braces as they are not used in our shell scripts.
@TravisWhitaker Also could you provide an example of how you use it? If the repo is private and is inaccessible for testing that's fine. I think that would help with seeing how the option you introduce is helpful and flexible. |
@TravisWhitaker Are you still interested in finishing this? |
Thank you for your contributions. This has been automatically marked as stale because it has had no activity for 180 days. If this is still important to you, we ask that you leave a comment below. Your comment can be as simple as "still important to me". This lets people see that at least one person still cares about this. Someone will have to do this at most twice a year if there is no other activity. Here are suggestions that might help resolve this more quickly:
|
I've moved to |
Motivation for this change
This adds an extra parameter
extraConfig
tofetchgit
, allowing extra contents to be appended to.git/config
before fetching. This is useful in some circumstances; in particular I added this because I'm using an upstream repo that requires[url "..."]
sections in my local git config for submodules to be cloned correctly.This shouldn't impact any of the existing
fetchgit
call sites, but is something others may find useful.I'm no expert on the caveats of bash, so I'm not sure if there's a safer/better way to append to the config.
Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)nix path-info -S
before and after)