Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
V
vcsh
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Kevin Lyda
vcsh
Commits
e85f20d4
Commit
e85f20d4
authored
11 years ago
by
Richard Hartmann
Browse files
Options
Downloads
Patches
Plain Diff
vcsh: Add support for choosing relative or absolute core.worktree
parent
6927829e
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
doc/vcsh.1.ronn
+9
-0
9 additions, 0 deletions
doc/vcsh.1.ronn
vcsh
+12
-2
12 additions, 2 deletions
vcsh
with
21 additions
and
2 deletions
doc/vcsh.1.ronn
+
9
−
0
View file @
e85f20d4
...
@@ -184,6 +184,15 @@ Interesting knobs you can turn:
...
@@ -184,6 +184,15 @@ Interesting knobs you can turn:
Defaults to <exact>.
Defaults to <exact>.
* <$VCSH_VCSH_WORKTREE>:
Can be <absolute>, or <relative>.
<absolute> will set an absolute path; defaulting to <$HOME>.
<relative> will set a path relative to <$GIT_DIR>.
Defaults to <absolute>.
Less interesting knobs you could turn:
Less interesting knobs you could turn:
* <$VCSH_DEBUG>:
* <$VCSH_DEBUG>:
...
...
This diff is collapsed.
Click to expand it.
vcsh
+
12
−
2
View file @
e85f20d4
...
@@ -81,6 +81,11 @@ fi
...
@@ -81,6 +81,11 @@ fi
[
-z
"
$VCSH_HOOK_D
"
]
&&
VCSH_HOOK_D
=
"
$XDG_CONFIG_HOME
/vcsh/hooks-enabled"
[
-z
"
$VCSH_HOOK_D
"
]
&&
VCSH_HOOK_D
=
"
$XDG_CONFIG_HOME
/vcsh/hooks-enabled"
[
-z
"
$VCSH_BASE
"
]
&&
VCSH_BASE
=
"
$HOME
"
[
-z
"
$VCSH_BASE
"
]
&&
VCSH_BASE
=
"
$HOME
"
[
-z
"
$VCSH_GITIGNORE
"
]
&&
VCSH_GITIGNORE
=
'exact'
[
-z
"
$VCSH_GITIGNORE
"
]
&&
VCSH_GITIGNORE
=
'exact'
[
-z
"
$VCSH_WORKTREE
"
]
&&
VCSH_WORKTREE
=
'absolute'
if
[
!
"x
$VCSH_WORKTREE
"
=
'xabsolute'
]
&&
[
!
"x
$VCSH_WORKTREE
"
=
'xrelative'
]
;
then
fatal
"'
\$
VCSH_WORKTREE' must equal 'absolute', or 'relative'"
1
fi
help
()
{
help
()
{
...
@@ -313,8 +318,13 @@ upgrade() {
...
@@ -313,8 +318,13 @@ upgrade() {
# because otherwise Git complains "fatal: core.bare and core.worktree
# because otherwise Git complains "fatal: core.bare and core.worktree
# do not make sense"
# do not make sense"
git config core.bare
false
git config core.bare
false
# in core.worktree, keep a relative reference to the base directory
# core.worktree may be absolute or relative to $GIT_DIR, depending on
# user preference
if
[
!
"x
$VCSH_WORKTREE
"
=
'xabsolute'
]
;
then
git config core.worktree
$(
cd
$GIT_DIR
&&
GIT_WORK_TREE
=
"
$VCSH_BASE
"
git rev-parse
--show-cdup
)
git config core.worktree
$(
cd
$GIT_DIR
&&
GIT_WORK_TREE
=
"
$VCSH_BASE
"
git rev-parse
--show-cdup
)
elif
[
!
"x
$VCSH_WORKTREE
"
=
'xrelative'
]
;
then
git config core.worktree
"
$VCSH_BASE
"
fi
[
!
"x
$VCSH_GITIGNORE
"
=
'xnone'
]
&&
git config core.excludesfile
".gitignore.d/
$VCSH_REPO_NAME
"
[
!
"x
$VCSH_GITIGNORE
"
=
'xnone'
]
&&
git config core.excludesfile
".gitignore.d/
$VCSH_REPO_NAME
"
git config vcsh.vcsh
'true'
git config vcsh.vcsh
'true'
use
use
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment