1
0
mirror of https://github.com/git/git.git synced 2024-09-29 19:01:25 +02:00
Commit Graph

5 Commits

Author SHA1 Message Date
Shawn O. Pearce
e301bfeea1 Fix new-workdir (again) to work on bare repositories
My day-job workflow involves using multiple workdirs attached to a
bunch of bare repositories.  Such repositories are stored inside of
a directory called "foo.git", which means `git rev-parse --git-dir`
will return "." and not ".git".  Under such conditions new-workdir
was getting confused about where the Git repository it was supplied
is actually located.

If we get "." for the result of --git-dir query it means we should
use the user supplied path as-is, and not attempt to perform any
magic on it, as the path is directly to the repository.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-08-22 15:18:13 -07:00
Simon Hausmann
b658d50325 git-new-workdir: Fix shell warning about operator == used with test.
Use = instead of == with test to test for equality.

Signed-off-by: Simon Hausmann <simon@lst.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-06-26 18:18:47 -07:00
Julian Phillips
09381b458f new-workdir: handle rev-parse --git-dir not always giving full path
rev-parse --git-dir outputs a full path - except for the single case
of when the path would be $(pwd)/.git, in which case it outputs simply
.git.  Check for this special case and handle it.

Signed-off-by: Julian Phillips <julian@quantumfyre.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-06-24 02:36:56 -07:00
Shawn O. Pearce
2e4aef5893 Allow contrib new-workdir to link into bare repositories
On one particular system I like to keep a cluster of bare Git
repositories and spawn new-workdirs off of them.  Since the bare
repositories don't have working directories associated with them
they don't have a .git/ subdirectory that hosts the repository we
are linking to.

Using a bare repository as the backing repository for a workdir
created by this script does require that the user delete core.bare
from the repository's configuration file, so that Git auto-senses
the bareness of a repository based on pathname information, and
not based on the config file.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-05-29 00:27:21 -07:00
Julian Phillips
4f01748d51 contrib/workdir: add a simple script to create a working directory
Add a simple script to create a working directory that uses symlinks
to point at an exisiting repository.  This allows having different
branches in different working directories but all from the same
repository.

Based on a description from Junio of how he creates multiple working
directories[1].  With the following caveat:

"This risks confusion for an uninitiated if you update a ref that
is checked out in another working tree, but modulo that caveat
it works reasonably well."

[1] http://article.gmane.org/gmane.comp.version-control.git/41513/

Signed-off-by: Julian Phillips <julian@quantumfyre.co.uk>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-31 01:26:28 -07:00