All of lore.kernel.org
 help / color / mirror / Atom feed
From: Maxime Hadjinlian <maxime.hadjinlian@gmail.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH] support/download: fetch all refs on full git clone
Date: Thu, 12 Nov 2015 12:02:39 +0100	[thread overview]
Message-ID: <CAGduivyHPkkG7f6K7h2KGBXHPS7h8hvn07B2bKJdrbwLsf2nFA@mail.gmail.com> (raw)
In-Reply-To: <1446871164-19229-1-git-send-email-vivien.didelot@savoirfairelinux.com>

Hi Vivien, all

On Sat, Nov 7, 2015 at 5:39 AM, Vivien Didelot <
vivien.didelot@savoirfairelinux.com> wrote:

> When specifying BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION, a user may want to
> specify the SHA of a reference different than a branch or tag.
>
> For instance, Gerrit stores the patchsets under refs/changes/xx/xxx, and
> Github stores the pull requests under refs/pull/xxx/head.
>
> When cloning a repository with --bare, you don't fetch these references.
> This patch uses --mirror for a full clone, in order to give the user
> access to all references of the Git repository.
>
> Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
> ---
>  support/download/git | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/support/download/git b/support/download/git
> index 0e6103b..357a558 100755
> --- a/support/download/git
> +++ b/support/download/git
> @@ -43,7 +43,7 @@ if [ -n "$(${GIT} ls-remote "${repo}" "${cset}" 2>&1)"
> ]; then
>  fi
>  if [ ${git_done} -eq 0 ]; then
>      printf "Doing full clone\n"
> -    ${GIT} clone ${verbose} --bare "${repo}" "${basename}"
> +    ${GIT} clone ${verbose} --mirror "${repo}" "${basename}"
>  fi
>
>  GIT_DIR="${basename}" \
> --
> 2.6.2
>
> I've read the different between bare and mirror and from what I
understand, mirrors implies bare and also maps the remotes branch to the
local branches.

Given that understanding, I am afraid I don't really get what you are
trying to do. From what I understand of Git, everything has a SHA ID, be
it, branches, tags, merge commit, even when you push -f you still have
access to previous state of your HEAD.

I cloned a repository from Github that had pull requests ongoing, I could
not find anything non-standard under .git/refs/, is there a specific
example that you could point to ? I don't know Gerrit nor how it works, so
maybe this was the issues you had ?

Finally, with the current mechanisms, you can specify a SHA, so if you are
trying to clone a PR, since it should be made from either a branch from the
local repository, or a whole other repository, you should be able to
specify it.

Again, I'm not sure I got what you were trying to do, maybe there's a
special use cases with Gerrit that I'm not aware of.

> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20151112/4abcf84a/attachment.html>

  reply	other threads:[~2015-11-12 11:02 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-07  4:39 [Buildroot] [PATCH] support/download: fetch all refs on full git clone Vivien Didelot
2015-11-12 11:02 ` Maxime Hadjinlian [this message]
2015-11-12 16:12   ` Vivien Didelot
2015-11-12 16:26     ` Maxime Hadjinlian
2015-11-12 17:07       ` Vivien Didelot
2015-11-13  6:49         ` Arnout Vandecappelle
2015-11-13 15:35           ` Vivien Didelot
2015-11-16  8:43           ` Jérôme Pouiller
2015-11-13 22:48     ` Yann E. MORIN
2015-11-13 23:04       ` Vivien Didelot
2015-11-19 17:38 ` Vivien Didelot
2015-11-29 17:53 ` Thomas Petazzoni

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=CAGduivyHPkkG7f6K7h2KGBXHPS7h8hvn07B2bKJdrbwLsf2nFA@mail.gmail.com \
    --to=maxime.hadjinlian@gmail.com \
    --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.