git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jeff King <peff@peff.net>
To: Michael Haggerty <mhagger@alum.mit.edu>
Cc: "Christian Couder" <christian.couder@gmail.com>,
	git@vger.kernel.org, "Junio C Hamano" <gitster@pobox.com>,
	"Ævar Arnfjörð Bjarmason" <avarab@gmail.com>,
	"Stefan Beller" <sbeller@google.com>,
	"Jonathan Nieder" <jrnieder@gmail.com>,
	"Jonathan Tan" <jonathantanmy@google.com>,
	"Duy Nguyen" <pclouds@gmail.com>,
	"Derrick Stolee" <stolee@gmail.com>,
	"Carlos Martín Nieto" <cmn@dwim.me>,
	"David Turner" <novalis@novalis.org>,
	"Johannes Schindelin" <Johannes.Schindelin@gmx.de>,
	"SZEDER Gábor" <szeder.dev@gmail.com>,
	"Christian Couder" <chriscool@tuxfamily.org>,
	"David Turner" <dturner@twopensource.com>
Subject: Re: [PATCH v2] t: make many tests depend less on the refs being files
Date: Fri, 25 May 2018 04:59:06 -0400	[thread overview]
Message-ID: <20180525085906.GA2948@sigill.intra.peff.net> (raw)
In-Reply-To: <615f57ad-7591-128a-0c42-660312d34ca2@alum.mit.edu>

On Fri, May 25, 2018 at 10:48:04AM +0200, Michael Haggerty wrote:

> >  test_expect_success "multi-fetch works off a 'clean' repository" '
> > -	rm -r "$GIT_DIR/svn" "$GIT_DIR/refs/remotes" "$GIT_DIR/logs" &&
> > +	rm -rf "$GIT_DIR/svn" "$GIT_DIR/refs/remotes" &&
> > +	git reflog expire --all --expire=all &&
> >  	mkdir "$GIT_DIR/svn" &&
> >  	git svn multi-fetch
> >  	'
> > 
> 
> `rm -rf "$GIT_DIR/refs/remotes"` is not kosher. I think it can be written
> 
>     printf 'option no-deref\ndelete %s\n' $(git for-each-ref
> --format='%(refname)' refs/remotes) | git update-ref --stdin
> 
> as long as the number of references doesn't exceed command-line limits.
> This will also take care of the reflogs. Another alternative would be to
> write it as a loop.

Perhaps:

  git for-each-ref --format="option no-deref%0adelete %(refname)" refs/remotes |
  git update-ref --stdin

-Peff

  reply	other threads:[~2018-05-25  8:59 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-23  5:25 [PATCH v2] t: make many tests depend less on the refs being files Christian Couder
2018-05-23  6:08 ` Junio C Hamano
2018-05-25  8:48 ` Michael Haggerty
2018-05-25  8:59   ` Jeff King [this message]
2018-05-25  9:05     ` Michael Haggerty
2018-05-25 11:22       ` Christian Couder
2018-05-25 11:21   ` Christian Couder

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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180525085906.GA2948@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=avarab@gmail.com \
    --cc=chriscool@tuxfamily.org \
    --cc=christian.couder@gmail.com \
    --cc=cmn@dwim.me \
    --cc=dturner@twopensource.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jonathantanmy@google.com \
    --cc=jrnieder@gmail.com \
    --cc=mhagger@alum.mit.edu \
    --cc=novalis@novalis.org \
    --cc=pclouds@gmail.com \
    --cc=sbeller@google.com \
    --cc=stolee@gmail.com \
    --cc=szeder.dev@gmail.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).