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

Re: [QGIT RFC] Unit tests for QGit

From
Karl Hasselström <kha@treskal.com>
Date
Aug 28, 2008, 15:31 UTC
Message-ID
<20080828153118.GA13169@diana.vm.bytemark.co.uk>
In-Reply-To
<e5bfff550808280429h63496f9byfa4454af7adb0e86@mail.gmail.com>
On 2008-08-28 13:29:25 +0200, Marco Costalba wrote:
Show 11 quoted lines
> On Wed, Aug 27, 2008 at 10:18 PM, Jan Hudec <bulb@ucw.cz> wrote:
>
> > Actually, I just wrote a first simple test for it. I didn't find
> > this (now the stg branch finds out properly), but I found another
> > problem -- when switching from non-stgit branch to a stgit one,
> > Git::init will not notice, because the path didn't change, so the
> > check is not re-run. Applies to the other direction too, of
> > course.
>
> I have never tested on repos where some branches are under stgit and
> others are not. Actually I even didn't know it was possible.

StGit has no per-repo data. It's all per-branch. "stg init" operates on the current branch, not the whole repo.

Show 8 quoted lines
> The command:
>
> isStGIT = run("stg branch", &stgCurBranch); // slow command
>
> is used to check if a repo is under StGit control, i.e 'stg init'
> has been run in the repo working directory (it doesn't mean that
> there are StGit patches applied or unapplied, could be also without
> them).

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.

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.

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

-- 
Karl Hasselström, kha@treskal.com
      www.treskal.com/kalle
Previous: Marco CostalbaNext: Marco Costalba
Message 13 of 17 in “[QGIT RFC] Unit tests for QGit”
  1. Jan HudecAug 8, 2008
  2. Benjamin SergeantAug 8, 2008
  3. Jan HudecAug 10, 2008
  4. Marco CostalbaAug 17, 2008
  5. Jan HudecAug 17, 2008
  6. Marco CostalbaAug 17, 2008
  7. Jan HudecAug 17, 2008
  8. Marco CostalbaAug 17, 2008
  9. Jan HudecAug 18, 2008
  10. Marco CostalbaAug 19, 2008
  11. Jan HudecAug 27, 2008
  12. Marco CostalbaAug 28, 2008
  13. Karl HasselströmAug 28, 2008
  14. Marco CostalbaAug 28, 2008
  15. Jan HudecAug 28, 2008
  16. Marco CostalbaAug 29, 2008
  17. Karl HasselströmAug 28, 2008

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.