All of lore.kernel.org
 help / color / mirror / Atom feed
* git-visualize(1) plumbing equivalent
@ 2026-10-03 10:10 Alejandro Colomar
  2026-10-03 13:45 ` D. Ben Knoble
  0 siblings, 1 reply; 7+ messages in thread
From: Alejandro Colomar @ 2026-10-03 10:10 UTC (permalink / raw)
  Cc: git

[-- Attachment #1: Type: text/plain, Size: 1125 bytes --]

Hi!

I have this code, which I use to loop in a script using git-bisect(1):

	while
		git bisect visualize --oneline \
		| wc -l \
		| xargs -I{} test {} -gt 1;
	do
		if
			git rebase $gropts BISECT_HEAD >/dev/null 2>/dev/null;
			test $? -eq 0;
		then
			echo 'Rebase: success';
			git bisect good BISECT_HEAD;
		else
			echo 'Rebase: conflict';
			git rebase --abort >/dev/null;
			git bisect bad BISECT_HEAD;
		fi;
	done;

(
I know this resembles "git rebase run", but I'm avoiding it, because
passing all of that as a command is non-trivial (and I'd like to avoid
having to write a separate script to pass its name to "git bisect run").
)

Having read the documentation for git-bisect(1), visualize reads several
environment variables, and thus this code doesn't seem robust.  What
would be the plumbing version of the while-loop condition?

		git bisect visualize --oneline \
		| wc -l \
		| xargs -I{} test {} -gt 1;

The goal is to know whether git-bisect(1) has found a commit yet or not,
to stop looping.


Have a lovely day!
Alex

-- 
<https://www.alejandro-colomar.es>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2026-10-03 17:50 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-03 10:10 git-visualize(1) plumbing equivalent Alejandro Colomar
2026-10-03 13:45 ` D. Ben Knoble
2026-10-03 15:13   ` Alejandro Colomar
2026-10-03 17:10     ` D. Ben Knoble
2026-10-03 17:50       ` Alejandro Colomar
2026-10-03 15:26   ` Kristoffer Haugsbakk
2026-10-03 17:09     ` D. Ben Knoble

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.