Skip to contentSkip to conversation

StGIT 0.13 recognizes but not list packed StGIT controlled branches

DISCUSSION Jakub Narebski 3 participants 8 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

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)?

Signature · 2 lines
Jakub Narebski
Poland
#1 lore raw
Quoted 2 lines · Jakub Narebski

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                
#2 lore raw
In reply to Jakub Narebski
Quoted 4 lines · Jakub Narebski

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).

Quoted 2 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>'.

Signature · 1 line
Catalin
#3 lore raw
Quoted 9 lines · Catalin Marinas
Quoted 4 lines · Jakub Narebski

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)...

Quoted 7 lines
Quoted 2 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.

Signature · 2 lines
Jakub Narebski
Poland
#4 lore raw
Quoted 8 lines · Jakub Narebski
Quoted 7 lines · Catalin Marinas
Quoted 4 lines · Jakub Narebski

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.

Quoted 6 lines
Quoted 2 lines

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.

Signature · 1 line
Catalin
#5 lore raw
Quoted 11 lines · Catalin Marinas
Quoted 8 lines · Jakub Narebski
Quoted 3 lines · Catalin Marinas

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>"...

Signature · 2 lines
Jakub Narebski
Poland
#6 lore raw
Quoted 2 lines · Jakub Narebski

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.

Quoted 2 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).

Signature · 1 line
Catalin
#7 lore raw
Quoted 6 lines · Catalin Marinas
Quoted 3 lines · Jakub Narebski

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.

Quoted 6 lines
Quoted 2 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 (!)).

Signature · 2 lines
Jakub Narebski
Poland