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

Re: finding the right remote branch for a commit

From
MKmartin f krafft <madduck@madduck.net>
Date
Jul 12, 2007, 07:47 UTC
Message-ID
<20070712074745.GA28507@piper.oerlikon.madduck.net>
In-Reply-To
<Pine.LNX.4.64.0707112226170.4516@racer.site>
also sprach Johannes Schindelin <Johannes.Schindelin@gmx.de> [2007.07.11.2326 +0200]:
> Okay, after discussing this for a bit on IRC, here is what I would
> do (I already said this on IRC, but the mailing list is really the
> better medium for this):

I agree. However, I find IRC to have its merits. For instance, all of our discussion yesterday would have taken days over the list, but on IRC I was able to interject when I did not understand something or you could stop me when I was going down a garden path.

Of course, IRC isn't archived in the sense that lists are, which is why I make an effort to send updates to the list, such as I did to another thread yesterday: http://marc.info/?l=git&m=118418250002028&w=2

> I would actually rename .etc/ into gits/, because it is not
> a directory containing settings, but a directory containing
> repositories.

Yes and no. I already use ~/.etc/ to store my settings and symlink into it, but I do like your idea too, actually. I have yet to go and try it, and I shall report back then.

> Everytime I would work on, say, .vimrc, I would say
> "--git-dir=$HOME/gits/vim.git", or maybe even make an alias in
> $HOME/.gitconfig, which spares me that:

I wish there were a way to determine which repository a file belongs to and then to automatically select the right repository. I guess one can script that by iterating all repos and using git-ls-files, possibly caching the result.

Anyway, I tried your approach and failed:
  $ mkdir repo
  $ GIT_DIR=repo git init
  $ GIT_DIR=repo git config core.bare false
  $ echo 1 >a; GIT_DIR=repo git add a; GIT_DIR=repo git commit -m.
  fatal: add must be run in a work tree
  nothing to commit (use "git add file1 file2" to include for commit)
I am probably doing something wrong, but what?
> Come to think of it, this is maybe what I would have done, but it appears 
> to me that this is the _ideal_ use case for worktree:

Yes, it does. I am downloading the source now and intend to work with the HEAD (is that the right term for what I used to call trunk when I was doing SVN?) from now on (instead of the Debian package).

Show 7 quoted lines
> - you have to say
> 
>   $ git --work-tree=$HOME --bare init
> 
>   which is a bit counterintuitive.  After all, it is _not_ a bare 
>   repository.  The whole purpose of worktree, as far as I understand, is 
>   to have a _detached_ repository, which would otherwise be called bare.
I said
  GIT_DIR=repo git --work-tree `pwd` init

and that seems to do everything it should, it sets core.worktree to . and core.bare to false.

> Those are serious bugs.  Matthias, any idea how to fix them?

That would be splendid. I am operating off HEAD now, so feel free to prod me for any testing.

-- 
martin;              (greetings from the heart of the sun.)
  \____ echo mailto: !#^."<*>"|tr "<*> mailto:" net@madduck
 
spamtraps: madduck.bogus@madduck.net
 
"a scientist once wrote that all truth passes through three stages:
 first it is ridiculed, then violently opposed and eventually,
 accepted as self-evident."
                                                       -- schopenhauer
Previous: Johannes SchindelinNext: Jakub Narebski
Message 3 of 7 in “finding the right remote branch for a commit”
  1. martin f krafftJul 10, 2007
  2. Johannes SchindelinJul 11, 2007
  3. martin f krafftJul 12, 2007
  4. Jakub NarebskiJul 12, 2007
  5. Matthias LederhoferJul 15, 2007
  6. Johannes SchindelinJul 15, 2007
  7. Matthias LederhoferJul 16, 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.