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

Re: [PATCH 3/5] Clean up work-tree handling

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Jul 27, 2007, 10:50 UTC
Message-ID
<Pine.LNX.4.64.0707271146290.14781@racer.site>
In-Reply-To
<20070726220949.GA4420@moooo.ath.cx>
Hi,
On Fri, 27 Jul 2007, Matthias Lederhofer wrote:
Show 12 quoted lines
> Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
> > +const char *get_git_work_tree(void)
> > +{
> > +	static int initialized = 0;
> > +	if (!initialized) {
> > +		work_tree = getenv(GIT_WORK_TREE_ENVIRONMENT);
> > +		if (!work_tree) {
> > +			work_tree = git_work_tree_cfg;
> > +			if (work_tree && !is_absolute_path(work_tree))
> > +			work_tree = git_path(work_tree);
> 
> A tab is missing here.
Right.  And as Junio pointed out, an xstrdup().
Show 7 quoted lines
> > -				fprintf(stderr, "No directory given for --work-tree.\n" );
> > +				error("No directory given for --work-tree.\n");
> 
> There should probably be no '\n' at the end when the 'error' function
> is used.  There are two other calls to fprintf(stderr, <error message>)
> next to the one you changed, why did you change this one but not the
> other ones?
Well, that is a left over of some unrelated editing.

The patch series that I sent out was deficient in many ways, but I was tired, and wanted to show where I am heading.

ATM I am trying to finish up this series, with quite a few changes to the code I sent out.

But there is a fundamental question I have to ask: Is there any reason why 
	$ git --git-dir=/some/where/else.git bla

should pretend that the repo is bare if core.bare == 1? I mean, we are implicitely setting the work tree to the cwd, no?

IOW I see the merits of "core.bare = false" (to prevent harm when calling git inside the git directory), but I cannot see the merits of "core.bare = true". Someone enlighten me?

Ciao, Dscho

Previous: Junio C HamanoNext: Junio C Hamano
Message 8 of 10 in “Clean up work-tree handling”
  1. 3/5 Clean up work-tree handlingJohannes Schindelin, Jul 26, 2007
  2. Shawn O. PearceJul 26, 2007
  3. Junio C HamanoJul 26, 2007
  4. Johannes SchindelinJul 26, 2007
  5. Junio C HamanoJul 26, 2007
  6. Matthias LederhoferJul 26, 2007
  7. Junio C HamanoJul 26, 2007
  8. Johannes SchindelinJul 27, 2007
  9. Junio C HamanoJul 27, 2007
  10. Johannes SchindelinJul 27, 2007

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.