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

Re: [PATCH] rev-parse: rev-parse: add --is-shallow-repository

From
Øystein Walle <oystwa@gmail.com>
Date
Sep 19, 2017, 18:51 UTC
Message-ID
<20170919185156.4285-1-oystwa@gmail.com>
In-Reply-To
<xmqqlglbqstw.fsf@gitster.mtv.corp.google.com>
> Hm, can you say more about the context?  From a certain point of view,
> it might make sense for that command to succeed instead: if the repo
> is already unshallow, then why should't "fetch --unshallow" complain
> instead of declaring victory?

A fellow in #git on Freenode was writing a script for automation and encountered this error, and asked how to find out whether a repo was shallow. My *first instinct* was to check if rev-parse had a flag for it; I wouldn't have been surprised if it did.

I agree that treating it as a fatal error is a bit much in the first place, but I also think having a way to check can be useful. I also wonder if a lot of the stuff rev-parse is used for now should be moved to some sort of `git misc` command, but that's a different can of worms, so into rev-parse a new flag went.

> What does git-path mean here?  I wonder if it's a copy/paste error.
> ...
> Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>

Yeah, the titles were copy-pasted without adjusting, thanks for fixing, Jonathan! ;)

> I agree with the fixes to the test titles suggested, so I'll queue the
> patch with the fixes squashed in.  Hearing "yeah, the titles were
> copy-pasted without adjusting, thanks for fixing, Jonathan!" sent by
> =C3=98ystein would be super nice.
Sounds good. Thanks for queueing my patch. My fourth!
�sse
Previous: Junio C Hamano
Message 4 of 4 in “rev-parse: rev-parse: add --is-shallow-repository”
  1. rev-parse: rev-parse: add --is-shallow-repositoryØystein Walle, Sep 18, 2017
  2. Jonathan NiederSep 19, 2017
  3. Junio C HamanoSep 19, 2017
  4. Øystein WalleSep 19, 2017

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.