Age | Commit message (Collapse) | Author |
|
|
|
|
|
Update the code that extracts the base name from a git repo URL so that
it can deal with URLs like "git@server:repo".
|
|
improve hash mismatch error message.
|
|
in some cases `git show` include tag information in the output
this is suppressed by the parameter '-1'
|
|
json requires certain characters to be escaped in strings.
|
|
This fixes a regression caused by commit f56ab9e
("nix-prefetch-git: Include the date in the machine-readable [...]")
where a couple of directory paths printed by pushd/popd appeared before
the JSON output on stdout (thus breaking it). Fix it by redirecting the
extraneous output to /dev/null.
Reported by Michael Alan Dorman <mdorman@ironicdesign.com>.
|
|
stdout, in strict ISO 8601 format.
This will be helpful for automatically updating fetchgit expressions
and the dates in version numbers associated with them.
|
|
|
|
Used shellcheck (https://github.com/koalaman/shellcheck) to validate
the script and fixed any resulting escaping and ambiguity issues.
|
|
fetchgit: remove only .git folder
|
|
Source of this change goes back to 2009 and original version of
fetchgit at 205fb0c87eab5dd53c6a0e97b1ff0e48f141c902.
The nondeterminism is really caused by changing .git so leave other
files alone as they might be interesting.
Note: this causes a hash mismatch with Hydra's version of Git Plugin
which we should fix to comply.
|
|
|
|
The function wasn't checking that *all* of the characters where
[a-z0-9]. Fixes #13921
|
|
JSON output
Previously, nix-prefetch-git would report the same JSON whether submodules were being fetched or not; with this change, the --fetch-submodules option will cause the JSON output to include "fetchSubmodules": true, so that fetchgit (builtins.fromJSON (builtins.readFile ./path/to/output.json)) will work.
|
|
As discussed on the mailing list. The nix output was short-lived so it's
probably okay to change it.
|
|
|
|
|
|
It turns out hashFormat has never been set.
|
|
This commit fixes #6651.
Before this change the `nix-prefetch-git` script would use a different store
name than nix's `fetchgit` function. Because of that it was not possible to
use `nix-prefetch-git` as a way to pre-populate the store (for example when
the user it using private git dependencies that needs access to the ssh agent)
|
|
The comment related to the `deepClone` and `no-deepClone` options was
misleading as these options have no relation with submodules, but on the
the depth in `git clone --depth n`.
|
|
Add help flag to nix-prefetch-git
|
|
Fixes https://github.com/NixOS/nixpkgs/issues/11284.
|
|
|
|
Close #9790.
This fixes checkouting for a nasty combination:
1. To be checkouted is a revision which corresponds to tag in a form "<tag>^{}".
2. This revision is not fetched by default.
|
|
|
|
This is useful when `leaveDotGit = true` and some other derivation
expects some branch name to exist.
Previously, `nix-prefetch-git` always created a branch with a
hard-coded name (`fetchgit`).
|
|
The commit date can be used as a version number in packages that don't
have proper releases.
|
|
|
|
|
|
|
|
This reverts commit f8a833cfb149b35d590e0f63fe194d1f4f9db42a.
This makes sure the check returns a zero code.
See discussion on https://github.com/NixOS/nixpkgs/commit/5af576f
|
|
This reverts commit 5af576ff7f4e657c0053f66d6fba03bfd1e97669.
See discussion on https://github.com/NixOS/nixpkgs/commit/5af576f
|
|
|
|
Without this, the generated pack files are non-deterministic.
I didn't notice this issue in my earlier testing, because my test repo
had too few commits for the thread scheduling to take effect. (Test repo
had about 10 commits.)
|
|
Add more files to the delete list:
* .git/FETCH_HEAD
* .git/ORIG_HEAD
* .git/refs/remotes/origin/HEAD
* .git/config
Further, remove all remote branches, remove tags not reachable from the
given 'rev', do a full repack and then garbage collect unreferenced
objects.
According to my testing, the result is fully deterministic. As in "any
change done to the upstream repo, ahead of 'rev', will not affect the
hash of the resulting 'clone'". Even changing the clone URL will not
change the output hash, because .git/config is removed.
A new version of git can of course change store format, but that's
unavoidable.
For big repositories, the repack operation may be a bit heavy. But as
far as I can see there is no cheaper way to determinism.
|
|
Shell isn't Perl ;-)
|
|
Use 4 spaces per indent level instead of a mix of 2 spaces, 4 spaces and
hardtab. (According to nixpkgs coding style for shell scripts.)
|
|
Fixes a regression on OS X introduced by f83af95.
Don't use --tmpdir for mktemp, because that flag doesn't exist on OS X.
However, using -t is deprecated in GNU coreutils, so as suggested by
@ip1981 we're now using parameter expansion on ${TMPDIR:-/tmp} to
provide /tmp as a fallback if TMPDIR is not set and use it instead.
Also use this approach for nix-prefetch-cvs now in order to stay
consistent.
Reported-by: Vladimir Kirillov <proger@wilab.org.ua>
Tested-by: Igor Pashev <pashev.igor@gmail.com>
Signed-off-by: aszlig <aszlig@redmoonstudios.org>
|
|
Instead of relying on $$ to not collide with an existing path.
Quoting the Bash manual about $$:
> Expands to the process ID of the shell. In a () subshell, it expands
> to the process ID of the current shell, not the subshell.
So, this is different from $BASHPID:
> Expands to the process ID of the current bash process. This differs
> from $$ under certain circumstances, such as subshells that do not
> require bash to be re-initialized.
But even $BASHPID is prone to race conditions if the process IDs wrap
around, so to be on the safe side, we're using mktemp here.
Closes #3784.
Signed-off-by: aszlig <aszlig@redmoonstudios.org>
|
|
that way, the stdout stays compatible with nix-prefetch-{bzr,svn,hg}
|
|
The shebang of .git/hooks depended the git's bash, which made the result
depend of that bash's path.
|
|
There was a few files containing timestamp, so we now remove them.
It shouldn't be a problem for logs. However, index might be. Anyway,
that's better than nothing.
|
|
I hope it will help make git-packages' versions much nicer
It's usually only useful in --deepClone is also specified.
|
|
If the user explictly gives a ref such as "refs/heads/master", `git
rev-parse` failed because we only checked out the `fetchgit`
branch. Now, we also try `git rev-parse fetchgit` if the first call
fails, which fixes the issue.
|
|
|
|
|
|
nix-prefetch-git does not convert relative submodule urls into absolute
urls based on the parent's origin. This patch adds support for
repositories which are using the relative url syntax.
|
|
The nix-prefect git script was broken when trying to parse certain
groups of submodules. This patch fixes the url detection for submodule
repositories to use the more reliable `git config` commands.
|
|
|