On Thu, Aug 28, 2008 at 5:31 PM, Karl Hasselström <kha@xxxxxxxxxxx> wrote:>> StGit has no per-repo data. It's all per-branch. "stg init" operates> on the current branch, not the whole repo.> Ok. Thanks. In this case the check qgit does is broken, and I thinknot only that because I never had this point clear while developingthe interface. >> Hmm. For me, "stg branch" succeeds even if "stg init" has not yet been> run (which is arguably as it should be, since it doesn't require that> stg init has been run in the current branch). "stg series" or> something is probably better for this purpose.> But if I run 'stg branch' in a git-only repo this gives an error. Thisconditions, at least until now, has always been working for me. > Though if you're concerned about speed (as the comment indicates), you> should probably do something cheaper than running stg, such as> checking if .git/patches/<branchname> exists.> Actually the actual code chunk is: // check for a StGIT stack QDir d = gitDir; if (d.exists("patches")) { // early skip isStGIT = run("stg branch", &stgCurBranch); // slow command stgCurBranch = stgCurBranch.trimmed(); } else isStGIT = false; Indeed I need the Stgit current branch name to filter out the refsfound with a following "git show-ref -d" command: The code chunk is actually // run the command and save output in runOutptif (!run("git show-ref -d", &runOutput)) return false; QStringList refsList = runOutput.split('\n', QString::SkipEmptyParts); FOREACH_SL (it, refsList) { QString revSha = (*it).left(40); QString refName = (*it).mid(41); // save StGIT patch sha, to be used later if (refName.startsWith("refs/patches/" + stgCurBranch + "/")) { .... we have found a reference to a StGit patch ofcurrent branch ... } ...... } >> So it's not very clear to me what does it mean "switching from>> non-stgit branch to a stgit one">> Switching from a branch where "stg init" hasn't been run, to one where> it has.> Thanks again. I don't know why but I was somehow sticked to the ideathat 'stg init' was behaving similar to 'git init', i.e. you need torun it only once per repo. Marco��.n��������+%������w��{.n��������n�r������&��z�ޗ�zf���h���~����������_��+v���)ߣ�m