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

Re: [QGIT RFC] Unit tests for QGit

From
JHJan Hudec <bulb@ucw.cz>
Date
Aug 27, 2008, 20:18 UTC
Message-ID
<20080827201819.GD15520@efreet.light.src>
In-Reply-To
<e5bfff550808190753t4f99ddb6q83886dbca27dbf03@mail.gmail.com>
On Tue, Aug 19, 2008 at 15:53:05 +0100, Marco Costalba wrote:
Show 9 quoted lines
> On Mon, Aug 18, 2008 at 7:00 PM, Jan Hudec <bulb@ucw.cz> wrote:
> > On Sun, Aug 17, 2008 at 21:30:46 +0100, Marco Costalba wrote:
> >> On Sun, Aug 17, 2008 at 8:58 PM, Jan Hudec <bulb@ucw.cz> wrote:
> >> >
> >> > But as I said, I only have basic infrastructure and am currently looking at
> >> > what to write tests for and how exactly that test should work. The detection
> >> > of git vs. stgit branch (does not work for me)
> >>
> >> This sounds as a bug. Could you elaborate on that please ?
I am slowly progressing towards writing a test case for it ;-).

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.

Show 15 quoted lines
> >> BTW the test for a StGit repo is:
> >>
> >> isStGIT = run("stg branch", &stgCurBranch); // slow command
> >>
> >> in function Git::getRefs() , file git_startup.cpp
> >
> > Yes, I've seen that command. But it returns true for me even when it's not
> > a stg branch :-(. I am not sure what the problem there is.
> >
> 
> That's interesting !
> 
> The command just runs "stg branch", in my StGit setup this returns an
> error (some stuff written to stderr) if the directory where it is run
> is not a StGit stack.

I don't recall the details (it was some time ago) and the repository might have been a bit screwed up. The point there was the branch /used to be/ a stgit one. So it was rather a problem of stgit keeping duplicate information all over the place.

> run() just detects the error and returns false.
By the way, I looked at the makefiles again and found that they are actually
regenerated correctly when you change the .pro files. While the master
makefile does not have dependencies for the subdir makefiles, each makefile
does have dependencies for itself. And make always tries to rebuild the
makefile before doing anything else. Therefore it does not work to:
    make src//Makefile
but it *does* work to:
    make -C src Makefile
(*and* it will rebuild the makefile when you 'make debug' or 'make release').

Regards, Jan

-- 
						 Jan 'Bulb' Hudec <bulb@ucw.cz>
Previous: Marco CostalbaNext: Marco Costalba
Message 11 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.