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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Kevin Lyda
vcsh
Commits
ff48c40a
Commit
ff48c40a
authored
Sep 9, 2013
by
Richard Hartmann
Browse files
Options
Downloads
Plain Diff
Merge branch 'master' into debian
parents
70ed44a9
09f129a2
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
changelog
+5
-0
5 additions, 0 deletions
changelog
doc/vcsh.1.ronn
+9
-0
9 additions, 0 deletions
doc/vcsh.1.ronn
vcsh
+24
-12
24 additions, 12 deletions
vcsh
with
38 additions
and
12 deletions
changelog
+
5
−
0
View file @
ff48c40a
2013-09-09 Richard Hartmann <richih.mailinglist@gmail.com>
* Release 1.20130909
* Add support for relative worktrees
2013-08-29 Richard Hartmann <richih.mailinglist@gmail.com>
* Release 1.20130829
...
...
This diff is collapsed.
Click to expand it.
doc/vcsh.1.ronn
+
9
−
0
View file @
ff48c40a
...
...
@@ -184,6 +184,15 @@ Interesting knobs you can turn:
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:
* <$VCSH_DEBUG>:
...
...
This diff is collapsed.
Click to expand it.
vcsh
+
24
−
12
View file @
ff48c40a
...
...
@@ -24,7 +24,7 @@ basename() {
}
SELF
=
$(
basename
$0
)
VERSION
=
'1.20130
82
9'
VERSION
=
'1.20130
90
9'
fatal
()
{
echo
"
$SELF
: fatal:
$1
"
>
&2
...
...
@@ -81,6 +81,15 @@ fi
[
-z
"
$VCSH_HOOK_D
"
]
&&
VCSH_HOOK_D
=
"
$XDG_CONFIG_HOME
/vcsh/hooks-enabled"
[
-z
"
$VCSH_BASE
"
]
&&
VCSH_BASE
=
"
$HOME
"
[
-z
"
$VCSH_GITIGNORE
"
]
&&
VCSH_GITIGNORE
=
'exact'
[
-z
"
$VCSH_WORKTREE
"
]
&&
VCSH_WORKTREE
=
'absolute'
if
[
!
"x
$VCSH_GITIGNORE
"
=
'xexact'
]
&&
[
!
"x
$VCSH_GITIGNORE
"
=
'xnone'
]
&&
[
!
"x
$VCSH_GITIGNORE
"
=
'xrecursive'
]
;
then
fatal
"'
\$
VCSH_GITIGNORE' must equal 'exact', 'none', or 'recursive'"
1
fi
if
[
!
"x
$VCSH_WORKTREE
"
=
'xabsolute'
]
&&
[
!
"x
$VCSH_WORKTREE
"
=
'xrelative'
]
;
then
fatal
"'
\$
VCSH_WORKTREE' must equal 'absolute', or 'relative'"
1
fi
help
()
{
...
...
@@ -214,9 +223,8 @@ hook() {
init
()
{
hook pre-init
[
!
-e
"
$GIT_DIR
"
]
||
fatal
"'
$GIT_DIR
' exists"
10
export
GIT_WORK_TREE
=
"
$VCSH_BASE
"
mkdir
-p
"
$GIT_WORK_TREE
"
||
fatal
"could not create '
$GIT_WORK_TREE
'"
50
cd
"
$GIT_WORK_TREE
"
||
fatal
"could not enter '
$GIT_WORK_TREE
'"
11
mkdir
-p
"
$VCSH_BASE
"
||
fatal
"could not create '
$VCSH_BASE
'"
50
cd
"
$VCSH_BASE
"
||
fatal
"could not enter '
$VCSH_BASE
'"
11
git init
upgrade
hook post-init
...
...
@@ -269,7 +277,6 @@ push() {
}
retire
()
{
unset
GIT_WORK_TREE
unset
VCSH_DIRECTORY
}
...
...
@@ -311,17 +318,26 @@ status() {
upgrade
()
{
hook pre-upgrade
use
git config core.worktree
"
$GIT_WORK_TREE
"
# fake-bare repositories are not bare, actually. Set this to false
# because otherwise Git complains "fatal: core.bare and core.worktree
# do not make sense"
git config core.bare
false
# 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
)
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
"
git config vcsh.vcsh
'true'
use
[
-e
"
$VCSH_BASE
/.gitignore.d/
$VCSH_REPO_NAME
"
]
&&
git add
-f
"
$VCSH_BASE
/.gitignore.d/
$VCSH_REPO_NAME
"
hook post-upgrade
}
use
()
{
git_dir_exists
export
GIT_WORK_TREE
=
"
$(
git config
--get
core.worktree
)
"
export
VCSH_DIRECTORY
=
"
$VCSH_REPO_NAME
"
}
...
...
@@ -370,10 +386,6 @@ write_gitignore() {
fatal
"could not move '
$tempfile
' to '
$VCSH_BASE
/.gitignore.d/
$VCSH_REPO_NAME
'"
53
}
if
[
!
"x
$VCSH_GITIGNORE
"
=
'xexact'
]
&&
[
!
"x
$VCSH_GITIGNORE
"
=
'xnone'
]
&&
[
!
"x
$VCSH_GITIGNORE
"
=
'xrecursive'
]
;
then
fatal
"'
\$
VCSH_GITIGNORE' must equal 'exact', 'none', or 'recursive'"
1
fi
if
[
"
$1
"
=
'clone'
]
;
then
[
-z
"
$2
"
]
&&
fatal
"
$1
: please specify a remote"
1
export
VCSH_COMMAND
=
"
$1
"
...
...
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