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

Re: [PATCHv3] parse-remote: handle detached HEAD

From
SBSanti Béjar <santi@agolina.net>
Date
Dec 6, 2010, 14:32 UTC
Message-ID
<AANLkTik4LLCm3WzcKPkOY44M88vF7oT2nuLrv-S3L22X@mail.gmail.com>
In-Reply-To
<1291630811-16584-1-git-send-email-santi@agolina.net>
On Mon, Dec 6, 2010 at 11:20 AM, Santi Béjar <santi@agolina.net> wrote:
Show 18 quoted lines
> get_remote_merge_branch with zero or one arguments returns the
> upstream branch. But a detached HEAD does no have an upstream branch,
> as it is not tracking anything. Handle this case testing the exit code
> of "git symbolic-ref -q HEAD".
>
> Reported-by: Sverre Rabbelier <srabbelier@gmail.com>
> Signed-off-by: Santi Béjar <santi@agolina.net>
> ---
>
>> If that is the case, shouldn't we be not calling "echo" at all to begin
>> with?  IOW, shouldn't the code read more like this?
>>
>>        curr_branch=$(git symbolic-ref -q HEAD) &&
>>        test "$origin" = "$default" &&
>>        echo ...
>
> Or course, you are right. I didn't know/think about the exit
> code... Thanks.

Now that I think of... the final form of the patch is yours (Junio). Feel free to add something like this to the commit message:

Final patch form by Junio C Hamano

Or alternatively, take ownership of the patch and add something like "Patch handled by Santi Béjar but final patch form by Junio C Hamano" and:

Acked-by: Santi Béjar <santi@agolina.net>
Santi
Previous: Santi BéjarNext: Junio C Hamano
Message 6 of 8 in “parse-remote: handle detached HEAD”
  1. parse-remote: handle detached HEADSanti Béjar, Dec 5, 2010
  2. Sverre RabbelierDec 5, 2010
  3. [PATCHv2] parse-remote: handle detached HEADSanti Béjar, Dec 5, 2010
  4. Junio C HamanoDec 6, 2010
  5. [PATCHv3] parse-remote: handle detached HEADSanti Béjar, Dec 6, 2010
  6. Santi BéjarDec 6, 2010
  7. Junio C HamanoDec 6, 2010
  8. Sverre RabbelierDec 6, 2010

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.