ksummit.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: James Hogan <james.hogan@imgtec.com>
To: Josh Triplett <josh@joshtriplett.org>
Cc: ksummit-discuss@lists.linuxfoundation.org
Subject: Re: [Ksummit-discuss] [ANNOUNCE] git-series: track changes to a patch series over time
Date: Mon, 15 Aug 2016 13:53:09 +0100	[thread overview]
Message-ID: <20160815125309.GA21566@jhogan-linux.le.imgtec.org> (raw)
In-Reply-To: <20160729075039.GA26402@x>

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

Hi Josh,

On Fri, Jul 29, 2016 at 12:50:39AM -0700, Josh Triplett wrote:
> I'd welcome any feedback, whether on the interface and workflow, the
> internals and collaboration, ideas on presenting diffs of patch series,
> or anything else.

I often have patch series which are dependent on one another. It is then
very useful to be able to see all the branch names in logs (i.e. with
--decorate or using tig). This isn't possible out of the box with
git-series however since it seems to prefer to work on a detached head.

I sort of worked around this with a hacky script (see below) to update
my branches (which start with e.g. "4.8/") to point to the corresponding
git series latest commit.

Do you think it'd be practical and make sense for git-series to learn to
(optionally?) automatically remain on a particular branch (in my case
with the same name as the series) and keep it updated with rebases etc?
I realise the semantics of how it might work may be a little unclear at
the moment since the SHEAD doesn't get updated until git series commit.

Cheers
James

#!/bin/bash

V=4.8
if [ -n "$1" ]; then
	V=$(echo "$1" | sed 's/^v//')
fi

set -e

branches=$(git branch | grep -v 'detached from' | sed 's/^. //g')
for b in $(git series | grep '^. '$V'\/.*$' | sed 's/^. //g'); do
	if echo "$branches" | fgrep -qx "$b"; then
		brev=$(git rev-parse "$b")
		ref=$(echo $b | sed 's/^\(.*\)$/git-series\/\1^2/g')
		refrev=$(git rev-parse --verify --quiet "$ref" 2>&1 || true)
		if [ -z "$refrev" ]; then
			ref=$(echo $b | sed 's/^\(.*\)$/git-series\/\1^/g')
			refrev=$(git rev-parse --verify --quiet "$ref" 2>&1 || true)
			if [ -z "$refrev" ]; then
				continue
			fi
		fi
		if [ "$brev" != "$refrev" ]; then
			echo "Moving $b $brev...$refrev ($ref)"
			echo "  git branch -D \"$b\""
			echo "  git branch \"$b\" \"$ref\""
			echo -n "Go ahead [Y|n]? "
			read yes
			if [ "$yes" == "y" ]; then
				git branch -D "$b"
				git branch "$b" "$ref"
				echo "  done"
			fi
		fi
	fi
done

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

  parent reply	other threads:[~2016-08-15 12:53 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-29  7:50 Josh Triplett
2016-07-29 12:20 ` David Howells
2016-07-29 13:11   ` Josh Triplett
2016-08-04 22:46     ` Catalin Marinas
2016-08-04 23:07       ` Michael S. Tsirkin
2016-08-08 17:27         ` Catalin Marinas
2016-08-15 23:44           ` Michael S. Tsirkin
2016-08-04 23:46       ` Josh Triplett
2016-08-08 17:37         ` Catalin Marinas
2016-07-29 14:06   ` David Howells
2016-07-29 14:21     ` Christoph Lameter
2016-07-29 14:37       ` Josh Triplett
2016-07-29 15:00       ` Daniel Vetter
2016-07-29 15:18         ` Josh Triplett
2016-07-29 15:40           ` Daniel Vetter
2016-07-29 16:21             ` Josh Triplett
2016-07-29 16:31               ` Luis R. Rodriguez
2016-07-29 17:52       ` Bird, Timothy
2016-07-29 17:57         ` James Bottomley
2016-07-29 21:59           ` James Hogan
2016-07-30  2:55           ` Steven Rostedt
2016-07-29 20:13         ` David Howells
2016-07-30  5:02           ` Josh Triplett
2016-07-30  8:43             ` Arnd Bergmann
2016-08-04 12:44             ` Jani Nikula
2016-07-29 14:34     ` Josh Triplett
2016-07-29 14:37     ` David Howells
2016-07-29 14:56       ` Josh Triplett
2016-07-29 14:55 ` James Bottomley
2016-07-29 15:05   ` Josh Triplett
2016-08-09  0:10     ` Paul E. McKenney
2016-07-29 15:26 ` James Hogan
2016-08-04 23:52 ` Michael S. Tsirkin
2016-08-05 20:26   ` Josh Triplett
2016-08-15 13:20     ` James Hogan
2016-08-15 16:14       ` Josh Triplett
2016-08-15 23:42     ` Michael S. Tsirkin
2016-08-15 12:53 ` James Hogan [this message]
2016-08-15 16:34   ` Josh Triplett
2016-08-15 18:46     ` James Hogan
2016-08-15 21:35       ` Josh Triplett
2016-08-15 22:06         ` James Hogan
2016-08-15 23:59           ` Josh Triplett
2016-08-16  2:38             ` Michael S. Tsirkin

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=20160815125309.GA21566@jhogan-linux.le.imgtec.org \
    --to=james.hogan@imgtec.com \
    --cc=josh@joshtriplett.org \
    --cc=ksummit-discuss@lists.linuxfoundation.org \
    /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