From: Kristoffer Haugsbakk Date: Mon, 30 Jun 2025 11:13:56 GMT Subject: Re: changed output in git branch -a Message-ID: <55b294bc-833d-4115-823a-2008657e68dc@app.fastmail.com> In-Reply-To: <20250630121839.6252d9d9.olaf@aepfle.de> On Mon, Jun 30, 2025, at 12:23, Olaf Hering wrote: > Hello, > > my dumb script parses the output of "git --git-dir=some/dir/.git branch -a". > With git 2.43 it gets the expected list of "remote/branch". > With git 2.50 it also gets something like "remote/HEAD -> remote/branch". > > The newer version runs on a different system. It might be that the repository > was already cloned with a different format. For some reason it does have > .git/refs/remotes/${remote}/HEAD, but the system with the older git lacks > that entry. > > Is there a way to suppress such lines, or do I need to filter them manually? > There is no obvious knob mentioned in git-branch(1). Can you use something like git for-each-ref --format='%(refname:short)' --exclude='**/HEAD' Instead? The output of this f-e-r command is stable. -- Kristoffer Haugsbakk