threads / discuss / 10921

StGIT 0.13 recognizes but not list packed StGIT controlled branches

Subject: StGIT 0.13 recognizes but not list packed StGIT controlled branches

## tl;dr

8 messages between Nov 18, 2007 and Nov 19, 2007.

replies: 7people: 3as markdown or json

Jakub Narebski· Nov 18, 2007, 23:05 UTC · lore

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· Nov 19, 2007, 00:00 UTC · re: Jakub Narebski · lore

Re: StGIT 0.13 recognizes but not list packed StGIT controlled branches

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· Nov 19, 2007, 11:20 UTC · re: Jakub Narebski · lore

Re: StGIT 0.13 recognizes but not list packed StGIT controlled branches

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· Nov 19, 2007, 11:57 UTC · re: Catalin Marinas · lore

Re: StGIT 0.13 recognizes but not list packed StGIT controlled branches

Catalin Marinas wrote:
Show 9 quoted lines
> 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)...
 
Show 7 quoted lines
> > 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· Nov 19, 2007, 13:15 UTC · re: Jakub Narebski · lore

Re: StGIT 0.13 recognizes but not list packed StGIT controlled branches

On 19/11/2007, Jakub Narebski <jnareb@gmail.com> wrote:
Show 14 quoted lines
> 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· Nov 19, 2007, 17:43 UTC · re: Catalin Marinas · lore

Re: StGIT 0.13 recognizes but not list packed StGIT controlled branches

On Mon, 19 November 2007, Catalin Marinas wrote:
Show 11 quoted lines
> 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· Nov 19, 2007, 17:51 UTC · re: Jakub Narebski · lore

Re: StGIT 0.13 recognizes but not list packed StGIT controlled branches

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· Nov 19, 2007, 18:26 UTC · re: Catalin Marinas · lore

Re: StGIT 0.13 recognizes but not list packed StGIT controlled branches

Catalin Marinas wrote:
Show 6 quoted lines
> 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.

Show 6 quoted lines
>> 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

← back to recent threads