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
6faa6bcc
Commit
6faa6bcc
authored
11 years ago
by
Richard Hartmann
Browse files
Options
Downloads
Plain Diff
Merge branch 'master' of github.com:RichiH/vcsh
parents
24ef5b22
fba9277c
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
CONTRIBUTORS
+1
-0
1 addition, 0 deletions
CONTRIBUTORS
doc/vcsh.1.ronn
+4
-2
4 additions, 2 deletions
doc/vcsh.1.ronn
vcsh
+16
-8
16 additions, 8 deletions
vcsh
with
21 additions
and
10 deletions
CONTRIBUTORS
+
1
−
0
View file @
6faa6bcc
...
@@ -3,6 +3,7 @@ Alphabetical list of everyone who ever committed to this repository
...
@@ -3,6 +3,7 @@ Alphabetical list of everyone who ever committed to this repository
Vincent Demeester <vincent@demeester.fr>
Vincent Demeester <vincent@demeester.fr>
Thomas Ferris Nicolaisen <tfnico@gmail.com>
Thomas Ferris Nicolaisen <tfnico@gmail.com>
martin f. krafft <madduck@madduck.net>
martin f. krafft <madduck@madduck.net>
Alessandro Ghedini <alessandro@ghedini.me>
Valentin Haenel <valentin.haenel@gmx.de>
Valentin Haenel <valentin.haenel@gmx.de>
Richard Hartmann <richih.mailinglist@gmail.com>
Richard Hartmann <richih.mailinglist@gmail.com>
mek-apelsin <mek@pels.in>
mek-apelsin <mek@pels.in>
...
...
This diff is collapsed.
Click to expand it.
doc/vcsh.1.ronn
+
4
−
2
View file @
6faa6bcc
...
@@ -161,14 +161,16 @@ executed in the context of your shell.
...
@@ -161,14 +161,16 @@ executed in the context of your shell.
Interesting knobs you can turn:
Interesting knobs you can turn:
* <$VCSH_GITIGNORE>:
* <$VCSH_GITIGNORE>:
Can be
either
<exact>
or
<recursive>.
Can be <exact>
,
<recursive>
, or <none>
.
<exact> will seed the repo-specific
<.git
ignore
>
with all file and directory
<exact> will seed the repo-specific ignore
file
with all file and directory
names which `git ls-files` returns.
names which `git ls-files` returns.
<recursive> will descend through all directories recursively additionally to
<recursive> will descend through all directories recursively additionally to
the above.
the above.
<none> will not write any ignore file.
Defaults to <exact>.
Defaults to <exact>.
Less interesting knobs you could turn:
Less interesting knobs you could turn:
...
...
This diff is collapsed.
Click to expand it.
vcsh
+
16
−
8
View file @
6faa6bcc
...
@@ -264,7 +264,7 @@ upgrade() {
...
@@ -264,7 +264,7 @@ upgrade() {
hook pre-upgrade
hook pre-upgrade
use
use
git config core.worktree
"
$GIT_WORK_TREE
"
git config core.worktree
"
$GIT_WORK_TREE
"
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'
[
-e
"
$VCSH_BASE
/.gitignore.d/
$VCSH_REPO_NAME
"
]
&&
git add
-f
"
$VCSH_BASE
/.gitignore.d/
$VCSH_REPO_NAME
"
[
-e
"
$VCSH_BASE
/.gitignore.d/
$VCSH_REPO_NAME
"
]
&&
git add
-f
"
$VCSH_BASE
/.gitignore.d/
$VCSH_REPO_NAME
"
hook post-upgrade
hook post-upgrade
...
@@ -285,6 +285,12 @@ which() {
...
@@ -285,6 +285,12 @@ which() {
}
}
write_gitignore
()
{
write_gitignore
()
{
# Don't do anything if the user does not want to write gitignore
if
[
"x
$VCSH_GITIGNORE
"
=
'xnone'
]
;
then
info
"Not writing gitignore as '
\$
VCSH_GITIGNORE' is set to 'none'"
exit
fi
use
use
cd
"
$VCSH_BASE
"
||
fatal
"could not enter '
$VCSH_BASE
'"
11
cd
"
$VCSH_BASE
"
||
fatal
"could not enter '
$VCSH_BASE
'"
11
gitignores
=
$(
for
file
in
$(
git ls-files
)
;
do
gitignores
=
$(
for
file
in
$(
git ls-files
)
;
do
...
@@ -298,7 +304,7 @@ write_gitignore() {
...
@@ -298,7 +304,7 @@ write_gitignore() {
echo
'*'
>
"
$tempfile
"
||
fatal
"could not write to '
$tempfile
'"
57
echo
'*'
>
"
$tempfile
"
||
fatal
"could not write to '
$tempfile
'"
57
for
gitignore
in
$gitignores
;
do
for
gitignore
in
$gitignores
;
do
echo
"
$gitignore
"
|
sed
's@^@!/@'
>>
"
$tempfile
"
||
fatal
"could not write to '
$tempfile
'"
57
echo
"
$gitignore
"
|
sed
's@^@!/@'
>>
"
$tempfile
"
||
fatal
"could not write to '
$tempfile
'"
57
if
[
x
$VCSH_GITIGNORE
=
x
'recursive'
]
&&
[
-d
"
$gitignore
"
]
;
then
if
[
"
x
$VCSH_GITIGNORE
"
=
'
x
recursive'
]
&&
[
-d
"
$gitignore
"
]
;
then
{
echo
"
$gitignore
/*"
|
sed
's@^@!/@'
>>
"
$tempfile
"
||
fatal
"could not write to '
$tempfile
'"
57
;
}
{
echo
"
$gitignore
/*"
|
sed
's@^@!/@'
>>
"
$tempfile
"
||
fatal
"could not write to '
$tempfile
'"
57
;
}
fi
fi
done
done
...
@@ -315,8 +321,8 @@ write_gitignore() {
...
@@ -315,8 +321,8 @@ write_gitignore() {
fatal
"could not move '
$tempfile
' to '
$VCSH_BASE
/.gitignore.d/
$VCSH_REPO_NAME
'"
53
fatal
"could not move '
$tempfile
' to '
$VCSH_BASE
/.gitignore.d/
$VCSH_REPO_NAME
'"
53
}
}
if
[
!
"x
$VCSH_GITIGNORE
"
=
'xexact'
]
&&
[
!
"x
$VCSH_GITIGNORE
"
=
'xrecursive'
]
;
then
if
[
!
"x
$VCSH_GITIGNORE
"
=
'xexact'
]
&&
[
!
"x
$VCSH_GITIGNORE
"
=
'xrecursive'
]
&&
[
!
"x
$VCSH_GITIGNORE
"
=
'xnone'
]
;
then
fatal
"'
\$
VCSH_GITIGNORE' must
be either
'exact'
or
'recursive'"
1
fatal
"'
\$
VCSH_GITIGNORE' must
equal
'exact'
,
'recursive'
, or 'none'
"
1
fi
fi
if
[
"
$1
"
=
'clone'
]
;
then
if
[
"
$1
"
=
'clone'
]
;
then
...
@@ -380,9 +386,8 @@ if echo $VCSH_REPO_NAME | grep -q '/'; then
...
@@ -380,9 +386,8 @@ if echo $VCSH_REPO_NAME | grep -q '/'; then
export
VCSH_REPO_NAME
=
$(
basename
"
$VCSH_REPO_NAME
"
.git
)
export
VCSH_REPO_NAME
=
$(
basename
"
$VCSH_REPO_NAME
"
.git
)
fi
fi
check_dir
()
{
for
check_directory
in
"
$VCSH_REPO_D
"
"
$VCSH_BASE
/.gitignore.d"
check_directory
=
"
$1
"
do
if
[
!
-d
"
$check_directory
"
]
;
then
if
[
!
-d
"
$check_directory
"
]
;
then
if
[
-e
"
$check_directory
"
]
;
then
if
[
-e
"
$check_directory
"
]
;
then
fatal
"'
$check_directory
' exists but is not a directory"
13
fatal
"'
$check_directory
' exists but is not a directory"
13
...
@@ -391,7 +396,10 @@ do
...
@@ -391,7 +396,10 @@ do
mkdir
-p
"
$check_directory
"
||
fatal
"could not create '
$check_directory
'"
50
mkdir
-p
"
$check_directory
"
||
fatal
"could not create '
$check_directory
'"
50
fi
fi
fi
fi
done
}
check_dir
"
$VCSH_REPO_D
"
[
!
"x
$VCSH_GITIGNORE
"
=
'xnone'
]
&&
check_dir
"
$VCSH_BASE
/.gitignore.d"
verbose
"
$VCSH_COMMAND
begin"
verbose
"
$VCSH_COMMAND
begin"
export
VCSH_COMMAND
=
$(
echo
$VCSH_COMMAND
|
sed
's/-/_/g'
)
export
VCSH_COMMAND
=
$(
echo
$VCSH_COMMAND
|
sed
's/-/_/g'
)
...
...
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