# StGIT 0.13 recognizes but not list packed StGIT controlled branches

8 messages from 2007-11-18 to 2007-11-19. Participants: Jakub Narebski, Junio C Hamano, Catalin Marinas.
Thread: https://gitlist.dev/t/10921

## Jakub Narebski, 2007-11-18 23:05

Subject: StGIT 0.13 recognizes but not list packed StGIT controlled branches
Message-ID: <200711190005.49990.jnareb@gmail.com>
URL: https://gitlist.dev/e/200711190005.49990.jnareb%40gmail.com

```
I use Stacked GIT 0.13 with git 1.5.3.5 (and Python 2.4.3).
StGIT does recognize old StGIT branches (and converts them),
but "stg branch -l" list only one branch. I guess that is
cause by the fact that all the rest of branches are packed.

So the question is: how to unpack branches, and how to prevent
branches from being packed by "git-gc"?

Another StGIT question: how to check if given branch is controlled
by StGIT (needed for my bash prompt)?

-- 
Jakub Narebski
Poland

```

## Junio C Hamano, 2007-11-19 00:00

Subject: Re: StGIT 0.13 recognizes but not list packed StGIT controlled branches
Message-ID: <7vpry7t88g.fsf@gitster.siamese.dyndns.org>
URL: https://gitlist.dev/e/7vpry7t88g.fsf%40gitster.siamese.dyndns.org
In-Reply-To: <200711190005.49990.jnareb@gmail.com>

```
Jakub Narebski <jnareb@gmail.com> writes:

> So the question is: how to unpack branches, and how to prevent
> branches from being packed by "git-gc"?

I am afraid that is a wrong question.  How long have we had the
packed-refs anyway?

The question is "How to get the list of refs from a Porcelain if
it wants to be compatible with GIT v1.4.4-rc1 (Nov 7, 2006) and
later?", and the answer is for-each-ref.

Having said that, you could explode it by hand like this:

	git for-each-ref --format='%(objectname) %(refname)' refs/heads |
	while read sha1 refname
        do
        	test -f "$GIT_DIR/$refname" || 
               	git update-ref "$refname" "$sha1"
	done                

```

## Catalin Marinas, 2007-11-19 11:20

Subject: Re: StGIT 0.13 recognizes but not list packed StGIT controlled branches
Message-ID: <b0943d9e0711190320r28224763t5a6c9ed7758a12b3@mail.gmail.com>
URL: https://gitlist.dev/e/b0943d9e0711190320r28224763t5a6c9ed7758a12b3%40mail.gmail.com
In-Reply-To: <200711190005.49990.jnareb@gmail.com>

```
On 18/11/2007, Jakub Narebski <jnareb@gmail.com> wrote:
> I use Stacked GIT 0.13 with git 1.5.3.5 (and Python 2.4.3).
> StGIT does recognize old StGIT branches (and converts them),
> but "stg branch -l" list only one branch. I guess that is
> cause by the fact that all the rest of branches are packed.

Have you tried the latest StGIT snapshot. We added support for this
and it will be available in 0.14 (to be released pretty soon).

> Another StGIT question: how to check if given branch is controlled
> by StGIT (needed for my bash prompt)?

'stg branch -l' lists the branches and marks those controlled by
StGIT. For a simple test, just use a command which would fail on
non-stgit branches (stg id base). Yet another way is to check for the
presence of '.git/patches/<branch>'.

-- 
Catalin

```

## Jakub Narebski, 2007-11-19 11:57

Subject: Re: StGIT 0.13 recognizes but not list packed StGIT controlled branches
Message-ID: <200711191257.09158.jnareb@gmail.com>
URL: https://gitlist.dev/e/200711191257.09158.jnareb%40gmail.com
In-Reply-To: <b0943d9e0711190320r28224763t5a6c9ed7758a12b3@mail.gmail.com>

```
Catalin Marinas wrote:
> On 18/11/2007, Jakub Narebski <jnareb@gmail.com> wrote:
>
> > I use Stacked GIT 0.13 with git 1.5.3.5 (and Python 2.4.3).
> > StGIT does recognize old StGIT branches (and converts them),
> > but "stg branch -l" list only one branch. I guess that is
> > cause by the fact that all the rest of branches are packed.
> 
> Have you tried the latest StGIT snapshot? We added support for this
> and it will be available in 0.14 (to be released pretty soon).

Would it work with Python 2.4.3? Yes, I know I should upgrade my
Linux distribution (I use now Aurox 11.1, which is based on Fedora
Core 4)...
 
> > Another StGIT question: how to check if given branch is controlled
> > by StGIT (needed for my bash prompt)?
> 
> 'stg branch -l' lists the branches and marks those controlled by
> StGIT. For a simple test, just use a command which would fail on
> non-stgit branches (stg id base). Yet another way is to check for the
> presence of '.git/patches/<branch>'.

Thanks. 'stg id base' is quite a lot slower than 
'test -e "$(git rev-parse --git-dir)/patches/$branch"', and it _does_
matter in prompt creating.

-- 
Jakub Narebski
Poland

```

## Catalin Marinas, 2007-11-19 13:15

Subject: Re: StGIT 0.13 recognizes but not list packed StGIT controlled branches
Message-ID: <b0943d9e0711190515x3f58748bm224366ddb292755d@mail.gmail.com>
URL: https://gitlist.dev/e/b0943d9e0711190515x3f58748bm224366ddb292755d%40mail.gmail.com
In-Reply-To: <200711191257.09158.jnareb@gmail.com>

```
On 19/11/2007, Jakub Narebski <jnareb@gmail.com> wrote:
> Catalin Marinas wrote:
> > On 18/11/2007, Jakub Narebski <jnareb@gmail.com> wrote:
> >
> > > I use Stacked GIT 0.13 with git 1.5.3.5 (and Python 2.4.3).
> > > StGIT does recognize old StGIT branches (and converts them),
> > > but "stg branch -l" list only one branch. I guess that is
> > > cause by the fact that all the rest of branches are packed.
> >
> > Have you tried the latest StGIT snapshot? We added support for this
> > and it will be available in 0.14 (to be released pretty soon).
>
> Would it work with Python 2.4.3? Yes, I know I should upgrade my
> Linux distribution (I use now Aurox 11.1, which is based on Fedora
> Core 4)...

Yes, it works with Python 2.4. We deprecated the Python 2.3 support.

-- 
Catalin

```

## Jakub Narebski, 2007-11-19 17:43

Subject: Re: StGIT 0.13 recognizes but not list packed StGIT controlled branches
Message-ID: <200711191843.43247.jnareb@gmail.com>
URL: https://gitlist.dev/e/200711191843.43247.jnareb%40gmail.com
In-Reply-To: <b0943d9e0711190515x3f58748bm224366ddb292755d@mail.gmail.com>

```
On Mon, 19 November 2007, Catalin Marinas wrote:
> On 19/11/2007, Jakub Narebski <jnareb@gmail.com> wrote:
>> Catalin Marinas wrote:
>>>
>>> Have you tried the latest StGIT snapshot? We added support for this
>>> and it will be available in 0.14 (to be released pretty soon).
>>
>> Would it work with Python 2.4.3? Yes, I know I should upgrade my
>> Linux distribution (I use now Aurox 11.1, which is based on Fedora
>> Core 4)...
> 
> Yes, it works with Python 2.4. We deprecated the Python 2.3 support.

I was worried that it would require Python 2.5 (IIRC some stgit RPM
had it in requires)


By the way, does StGIT write something meaningful by default in reflog
messages? Because now my reflog looks like this:

2162:[autoconf@git]# git reflog
407d6dc... HEAD@{0}: 
5a46eb5... HEAD@{1}: 
[...]
ea55960... HEAD@{15}: 
8f5d6b4... HEAD@{16}: 
15bb3f6... HEAD@{17}: checkout: moving from master to autoconf
8aff795... HEAD@{18}: pull origin: Merge made by recursive.

It would be really nice if StGIT wrote something meaningfull when
updating ref, like "stg refresh: <something>", or "stg rebase: <sth>"...

-- 
Jakub Narebski
Poland

```

## Catalin Marinas, 2007-11-19 17:51

Subject: Re: StGIT 0.13 recognizes but not list packed StGIT controlled branches
Message-ID: <b0943d9e0711190951u412b2c1apf6d7d48abdd59c07@mail.gmail.com>
URL: https://gitlist.dev/e/b0943d9e0711190951u412b2c1apf6d7d48abdd59c07%40mail.gmail.com
In-Reply-To: <200711191843.43247.jnareb@gmail.com>

```
On 19/11/2007, Jakub Narebski <jnareb@gmail.com> wrote:
> By the way, does StGIT write something meaningful by default in reflog
> messages? Because now my reflog looks like this:

No, it leaves it up to GIT to write whatever it finds appropriate.

> It would be really nice if StGIT wrote something meaningfull when
> updating ref, like "stg refresh: <something>", or "stg rebase: <sth>"...

There is the 'stg log [<patch>]' command which shows the changes to a
specific patch. You can run it with -d (for the diff) or -g (to invoke
gitk).

-- 
Catalin

```

## Jakub Narebski, 2007-11-19 18:26

Subject: Re: StGIT 0.13 recognizes but not list packed StGIT controlled branches
Message-ID: <200711191926.07869.jnareb@gmail.com>
URL: https://gitlist.dev/e/200711191926.07869.jnareb%40gmail.com
In-Reply-To: <b0943d9e0711190951u412b2c1apf6d7d48abdd59c07@mail.gmail.com>

```
Catalin Marinas wrote:
> On 19/11/2007, Jakub Narebski <jnareb@gmail.com> wrote:
>>
>> By the way, does StGIT write something meaningful by default in reflog
>> messages? Because now my reflog looks like this:
> 
> No, it leaves it up to GIT to write whatever it finds appropriate.

But StGIT uses plumbing (or in the future perhaps PyGIT library).
And plumbing does not write by itself reflog messages. It is left
for porcelain (and StGIT being patch management interface is
porcelain) to provide reflog message in GIT_REFLOG_ACTION.

>> It would be really nice if StGIT wrote something meaningfull when
>> updating ref, like "stg refresh: <something>", or "stg rebase: <sth>"...
> 
> There is the 'stg log [<patch>]' command which shows the changes to a
> specific patch. You can run it with -d (for the diff) or -g (to invoke
> gitk).

If I remember correctly StGIT is made to be more friendly to and with
core-git. Providing reflog messages for "git reflog" / "git log -g"
would be nice.

Besides 'stg log [<patch>]' is a bit orthogonal: it describes history
of a patch, and I want history of HEAD or of branch head (with things
like refresh, new (!), goto, float / sink, rebase (!)).

-- 
Jakub Narebski
Poland

```
