git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v2] t: make many tests depend less on the refs being files

From
Christian Couder <christian.couder@gmail.com>
Date
May 25, 2018, 11:22 UTC
Message-ID
<CAP8UFD2gPoOqFbp18c3UFzp9XpGM8qrojzXsN1s4sXBEhCaF6g@mail.gmail.com>
In-Reply-To
<CAMy9T_E_wO-XKn-BoVpnoUn8cGsmE4z11AzbqW+7Ppo=P9zcDg@mail.gmail.com>
On Fri, May 25, 2018 at 11:05 AM, Michael Haggerty <mhagger@alum.mit.edu> wrote:
Show 29 quoted lines
> On Fri, May 25, 2018 at 10:59 AM, Jeff King <peff@peff.net> wrote:
>> 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
>
> Ah yes, that's nicer. I tried with `\n`, but that's not supported
> (wouldn't it be nice if it were?). I didn't think to try `%0a` (let
> alone look in the documentation!)
Thanks both for this suggestion. I plan to use it in another patch.
Previous: Michael HaggertyNext: Christian Couder
Message 6 of 7 in “t: make many tests depend less on the refs being files”
  1. t: make many tests depend less on the refs being filesChristian Couder, May 23, 2018
  2. Junio C HamanoMay 23, 2018
  3. Michael HaggertyMay 25, 2018
  4. Jeff KingMay 25, 2018
  5. Michael HaggertyMay 25, 2018
  6. Christian CouderMay 25, 2018
  7. Christian CouderMay 25, 2018

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.