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

Re: How can I automatically create a GIT branch that represents a sequence of tags?

From
Philip Oakley <philipoakley@iee.org>
Date
Aug 11, 2013, 07:49 UTC
Message-ID
<A728793F48D242F3BF93ACAA9D9F0F83@PhilipOakley>
In-Reply-To
<20130810232026.GF25779@paksenarrion.iveqy.com>
From: "Fredrik Gustafsson" <iveqy@iveqy.com>
Show 9 quoted lines
> On Sat, Aug 10, 2013 at 11:29:45PM +0100, Kristian Freed wrote:
>> In our current setup, we have automatic tagging in git of all
>> successful release builds. This makes it easy to go back to stable
>> points in history and compare functionality, check when bugs were
>> introduced etc.
>>
>> To help with this process further, it would be useful to be able to
>> use git bisect, but as these are just a sequence of tags, not commits
>> on a branch, git bisect will not work as is.

I was going to say simply use `git describe --contains <sha1>` and check the result is <tag>^0 first and then either skip the commit (git bisect skip) or test it.

Unfortunately I think it will conflict with the binary search style (i.e. a too sparse history with good tags). In such case it may be useful to have an alternate search style but that would be a code update.

Show 11 quoted lines
>>
>> Is there any tooling for automatically recreating a branch from a
>> sequence of tags, where each generated commit is the calculated delta
>> between each two neighbouring tags?
>
> I don't understand, why is it better to find between which tags a 
> error
> was found and not in what commit. It's much easier to find a bug
> introduced in a commit than in a tag/release. It sounds like you're
> doing the bug hunting harder. Could you explain this further?
>

I can see that in many commercial environments that this would be considered "best practice" (which actually equates to common practice, rather than good practice). Obviously in a FOSS environment the developers are willing to use the 'rebase until ready' approaches until their patches are acceptable. In a large corporate it can be that the fixes are locally good but globally bad, hence the extra tagging step.

Show 27 quoted lines
> It would be very hard to do a tool such as you describe, the reason is
> that there's no sane way to order your tags. Git today show tags
> alphabetically, all versions does not have a alphabtic order. You 
> could
> argue that it should be in the order of the tagged commits commit 
> date,
> however the commits are not ordered by date, an older commit can have 
> a
> younger commit as a parent. You could say that the tag order is the
> order you find the tags if you go from a branch and backwards in the
> history, however how do you then choose which path to take when you 
> find
> a merge?
>
> My suggestion if you want to do this, is to have your buildtool to
> checkout a special branch (let's call it tag_branch) do a git reset
> to get the worktree from the newly tagged commit and commit on that
> branch once for each tag it's creating, when it creates the tag.
>
> It would be quite easy to make a script that create such branch for 
> you,
> if you only can sort the tags somehow.
>
> -- 
> Med vänliga hälsningar
> Fredrik Gustafsson
>

-- Philip

Previous: Fredrik GustafssonNext: Kristian Freed
Message 5 of 9 in “How can I automatically create a GIT branch that represents a sequence of tags?”
  1. Kristian FreedAug 10, 2013
  2. Fredrik GustafssonAug 10, 2013
  3. Michael HaggertyAug 11, 2013
  4. Fredrik GustafssonAug 11, 2013
  5. Philip OakleyAug 11, 2013
  6. Kristian FreedAug 11, 2013
  7. Fredrik GustafssonAug 11, 2013
  8. Andreas SchwabAug 11, 2013
  9. Felipe ContrerasAug 11, 2013

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.