summaryrefslogtreecommitdiffstats
path: root/pkgs/build-support/fetchgit/nix-prefetch-git
AgeCommit message (Collapse)Author
2017-07-04fetchFromGitHub: fix fetchSubmodules=true when revision is not hexadecimalVolth
2017-07-03nix-prefetch-git: add --quiet to --helpHarmen
2017-06-24fetchgit: support "git@server:repo" URLsBjørn Forsman
Update the code that extracts the base name from a git repo URL so that it can deal with URLs like "git@server:repo".
2017-01-03nix-prefetch-git: remove call to non-existent print_metadata command; ↵Connor Clark
improve hash mismatch error message.
2016-12-05nix-prefetch-git: fix date fieldJörg Thalheim
in some cases `git show` include tag information in the output this is suppressed by the parameter '-1'
2016-12-05nix-prefetch-git: escape string fields properlyJörg Thalheim
json requires certain characters to be escaped in strings.
2016-07-04nix-prefetch-git: unbreak JSON outputBjørn Forsman
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>.
2016-07-03nix-prefetch-git: Include the date in the machine-readable output onDavid Grayson
stdout, in strict ISO 8601 format. This will be helpful for automatically updating fetchgit expressions and the dates in version numbers associated with them.
2016-06-15nix-prefetch-git: fix bash evaluation order dependencyBenno Fünfstück
2016-06-12nix-prefetch-git: shellcheck fixeszimbatm
Used shellcheck (https://github.com/koalaman/shellcheck) to validate the script and fixed any resulting escaping and ambiguity issues.
2016-05-16Merge pull request #15469 from NixOS/fetchgitEelco Dolstra
fetchgit: remove only .git folder
2016-05-15fetchgit: remove only .gitDomen Kožar
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.
2016-04-22nix-prefetch-git: create parent directoriesGuido Zgraggen
2016-03-23nix-prefetch-git: fix url_to_name heuristiczimbatm
The function wasn't checking that *all* of the characters where [a-z0-9]. Fixes #13921
2016-03-21nix-prefetch-scripts: make nix-prefetch-git report fetchSubmodules in its ↵Ryan Trinkle
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.
2016-02-29nix-prefetch-git: change the default output to JSONzimbatm
As discussed on the mailing list. The nix output was short-lived so it's probably okay to change it.
2016-02-27nix-prefetch-git: print out valid nix expression; make --quiet very quietTim Cuthbertson
2016-02-27nix-prefetch-git: add --quiet flag and minor cleanupTim Cuthbertson
2016-02-22nix-prefetch-git: output base32 hash so output matches nix-build errorsGraham Christensen
It turns out hashFormat has never been set.
2016-02-13nix-prefetch-git: use fetchgit's naming heuristiczimbatm
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)
2016-01-26Fix usage message in `nix-prefetch-git`Arnaud Spiwack
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`.
2016-01-19Merge pull request #10998 from andrewrynhard/masterDomen Kožar
Add help flag to nix-prefetch-git
2015-11-27nix-prefetch-git: make sure the script is interpreted by bashPeter Simons
Fixes https://github.com/NixOS/nixpkgs/issues/11284.
2015-11-12Add help flag to nix-prefetch-gitAndrew Rynhard
2015-09-20nix-prefetch-git: pull all tags from remote when checkouting by revisionNikolay Amiantov
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.
2015-04-21Add support for building cargo'ed Rust programsGeorges Dubus
2015-04-21fetchgit: Add support for specifying branch nameRicardo M. Correia
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`).
2015-02-24nix-prefetch-git: print commit date (close #6522)Bjørn Forsman
The commit date can be used as a version number in packages that don't have proper releases.
2014-12-04fetchgit: Simplify submodule url discoveryWilliam A. Kennington III
2014-11-15nix-prefetch-git: allow dots in submodule namesVincent Laporte
2014-11-10add parens to de ambiguifyEdward Tjörnhammar
2014-11-09Revert "Revert "initialized git repo should use the set http_proxy""Edward Tjörnhammar
This reverts commit f8a833cfb149b35d590e0f63fe194d1f4f9db42a. This makes sure the check returns a zero code. See discussion on https://github.com/NixOS/nixpkgs/commit/5af576f
2014-11-09Revert "initialized git repo should use the set http_proxy"Luca Bruno
This reverts commit 5af576ff7f4e657c0053f66d6fba03bfd1e97669. See discussion on https://github.com/NixOS/nixpkgs/commit/5af576f
2014-11-07initialized git repo should use the set http_proxyEdward Tjörnhammar
2014-11-03nix-prefetch-git: run single-threaded 'git repack'Bjørn Forsman
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.)
2014-11-02nix-prefetch-git: fix determinism with leaveDotGitBjørn Forsman
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.
2014-11-01nix-prefetch-git: remove unneeded semicolonsBjørn Forsman
Shell isn't Perl ;-)
2014-11-01nix-prefetch-git: whitespace cleanupBjørn Forsman
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.)
2014-08-27build-support: Fix nix-prefetch-* on OS X.aszlig
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>
2014-08-25build-support: Use mktemp -d in nix-prefetch-*.aszlig
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>
2014-08-17prefetch-git: output human-readable rev to stderrBenno Fünfstück
that way, the stdout stays compatible with nix-prefetch-{bzr,svn,hg}
2014-08-10Fixed deterministicness of fetchgit with leaveDotGitGeorges Dubus
The shebang of .git/hooks depended the git's bash, which made the result depend of that bash's path.
2014-08-08fetchgit: make deterministic with leaveDotGit (close #3392)Georges Dubus
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.
2014-06-25Print output of `git describe` in `nix-prefetch-git`Paul Colomiets
I hope it will help make git-packages' versions much nicer It's usually only useful in --deepClone is also specified.
2014-06-11nix-prefetch-git: fix printing of revisionBenno Fünfstück
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.
2014-05-16nix-prefetch-git: Print git revisionSimon Hengel
2014-03-25fetchgit: Implement option to not check out submodules.ambrop7@gmail.com
2014-01-10nix-prefetch-git: Convert relative submodule URLS to absolute URLSWilliam A. Kennington III
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.
2013-11-24Fix nix-prefetch-gitWilliam A. Kennington III
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.
2012-06-20Handle invalid referencesKirill Elagin