From: Yann E. MORIN <yann.morin.1998@free.fr>
To: buildroot@busybox.net
Subject: [Buildroot] [RFC PATCH 1/3] download/git: fix fetch all refs for old git
Date: Thu, 12 Apr 2018 19:42:37 +0200 [thread overview]
Message-ID: <20180412174237.GE4221@scaer> (raw)
In-Reply-To: <20180412092855.30621-2-ricardo.martincoski@gmail.com>
Ricardo, All,
On 2018-04-12 06:28 -0300, Ricardo Martincoski spake thusly:
> With old versions of git, when the shallow fetch was not enough, the
> download fails like this:
> Fetching all references
> Could not fetch special ref 'sha1'; assuming it is not special.
> fatal: reference is not a tree: sha1
>
> At git version 1.9.0, the semantics of the option -t for git fetch
> changed, see upstream commit [1]:
> < 1.9.0: "fetch tags without also fetching other references";
> >=1.9.0: "fetch tags *in addition to* other stuff".
>
> Fall back to explicit refspec to support distros that use ancient
> versions of git.
[--SNIP--]
> diff --git a/support/download/git b/support/download/git
> index 381f3ceeb3..1b09e5c750 100755
> --- a/support/download/git
> +++ b/support/download/git
> @@ -76,7 +76,7 @@ if [ -n "$(_git ls-remote origin "'${cset}'" 2>&1)" ]; then
> fi
> if [ ${git_done} -eq 0 ]; then
> printf "Fetching all references\n"
> - _git fetch origin -t
> + _git fetch origin -u "'+refs/tags/*:refs/tags/*'" "'+refs/heads/*:refs/remotes/origin/*'"
Why don't we just run:
git fetch origin
git fetch origin -t
As I understand it:
ancient git | new git
--------------------------------------------------------------------
git fetch | fetch all refs but tags | fetches all refs but tags
git fetch -t | fetches only tags | fetch all refs and tags
Right?
Regards,
Yann E. MORIN.
> fi
>
> # Try to get the special refs exposed by some forges (pull-requests for
> --
> 2.14.1
>
--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
| +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
'------------------------------^-------^------------------^--------------------'
next prev parent reply other threads:[~2018-04-12 17:42 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-12 9:28 [Buildroot] [RFC PATCH 0/3] fix some corner cases for download/git v1 Ricardo Martincoski
2018-04-12 9:28 ` [Buildroot] [RFC PATCH 1/3] download/git: fix fetch all refs for old git Ricardo Martincoski
2018-04-12 17:42 ` Yann E. MORIN [this message]
2018-04-13 18:23 ` Ricardo Martincoski
2018-04-15 12:12 ` Yann E. MORIN
2018-04-16 2:17 ` Ricardo Martincoski
2018-04-12 9:28 ` [Buildroot] [RFC PATCH 2/3] download/git: recover dirty cache Ricardo Martincoski
2018-04-12 17:48 ` Yann E. MORIN
2018-04-13 18:28 ` Ricardo Martincoski
2018-04-15 12:02 ` Yann E. MORIN
2018-04-16 2:54 ` Ricardo Martincoski
2018-04-16 16:01 ` Yann E. MORIN
2018-04-16 20:56 ` Yann E. MORIN
[not found] ` <1ffe206e-4b1e-c233-a511-ba4c3a8cb5f0@armadeus.com>
2018-04-17 10:42 ` Yann E. MORIN
2018-04-17 11:30 ` Thomas Petazzoni
2018-04-17 4:45 ` Ricardo Martincoski
2018-04-17 7:04 ` Ricardo Martincoski
2018-04-17 8:10 ` Arnout Vandecappelle
2018-04-17 8:56 ` Ricardo Martincoski
2018-04-17 10:36 ` Yann E. MORIN
2018-04-17 11:58 ` Arnout Vandecappelle
2018-04-12 9:28 ` [Buildroot] [RFC PATCH 3/3] download/git: unshallow when fetching all refs Ricardo Martincoski
2018-04-12 11:28 ` Thomas Petazzoni
2018-04-12 17:33 ` Yann E. MORIN
2018-04-13 18:32 ` Ricardo Martincoski
2018-04-15 12:08 ` Yann E. MORIN
2018-04-16 3:04 ` Ricardo Martincoski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180412174237.GE4221@scaer \
--to=yann.morin.1998@free.fr \
--cc=buildroot@busybox.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.