From: Osama Abdelkader <osama.abdelkader@gmail.com>
To: Paul Barker <paul@pbarker.dev>
Cc: bitbake-devel@lists.openembedded.org
Subject: Re: [PATCH 2/4] bitbake-layers: layerindex-fetch: Fix branch detection method
Date: Mon, 15 Dec 2025 23:34:37 +0100 [thread overview]
Message-ID: <aUCM_Y388wesrBe-@osama> (raw)
In-Reply-To: <016117db60e8c28186fd3ac5d078f9a0de727682.camel@pbarker.dev>
On Mon, Dec 15, 2025 at 11:54:20AM +0000, Paul Barker wrote:
> On Fri, 2025-12-12 at 20:08 +0100, Osama Abdelkader wrote:
> > Replace fragile parsing of 'git branch' output with the more reliable
> > 'git rev-parse --abbrev-ref HEAD' command to get the current branch name.
> > This avoids parsing issues and is the recommended way to get the current branch name.
>
> Do you have a source for this recommendation? I thought the preferred
> command was `git branch --show-current` as that just prints the branch
> name with no extra formatting.
Git commands are divided into two groups:
Porcelain - High level commands intended to be used at the command line
Plumbing - Low level commands intended for use in scripts
git rev-parse is a "plumbing" command, meaning its output format is guaranteed to be stable across different versions of Git.
It reliably outputs only the raw branch name to standard output.
git branch is a "porcelain" command, intended for human users. While git branch --show-current currently behaves helpfully,
the formatting of porcelain commands is theoretically subject to change in future Git releases, which could break your build
scripts unexpectedly.
https://git-scm.com/book/en/v2/Git-Internals-Plumbing-and-Porcelain
https://git-scm.com/docs/git-rev-parse
>
> Best regards,
>
> --
> Paul Barker
>
Best regards,
Osama
next prev parent reply other threads:[~2025-12-15 22:35 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-12 19:08 [PATCH 0/4] bitbake-layers: layerindex-fetch: respect --branch for already-configured layers Osama Abdelkader
2025-12-12 19:08 ` [PATCH 1/4] bitbake-layers: layerindex-fetch: Fix undefined stderr variable Osama Abdelkader
2025-12-15 11:52 ` Paul Barker
2025-12-12 19:08 ` [PATCH 2/4] bitbake-layers: layerindex-fetch: Fix branch detection method Osama Abdelkader
2025-12-15 11:54 ` Paul Barker
2025-12-15 22:34 ` Osama Abdelkader [this message]
2025-12-18 19:39 ` Paul Barker
2025-12-19 16:05 ` Osama Abdelkader
2025-12-12 19:08 ` [PATCH 3/4] bitbake-layers: layerindex-fetch: Respect --branch for already-configured layers Osama Abdelkader
2025-12-12 19:08 ` [PATCH 4/4] bitbake-layers: layerindex-fetch: Add branch check/switch for cooker layers Osama Abdelkader
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=aUCM_Y388wesrBe-@osama \
--to=osama.abdelkader@gmail.com \
--cc=bitbake-devel@lists.openembedded.org \
--cc=paul@pbarker.dev \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox