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
45d958ca
Commit
45d958ca
authored
Nov 22, 2011
by
Richard Hartmann
Browse files
Options
Downloads
Patches
Plain Diff
More refactoring cleanups; hopefully the end of this
parent
1536eb46
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
vcsh
+14
-14
14 additions, 14 deletions
vcsh
with
14 additions
and
14 deletions
vcsh
+
14
−
14
View file @
45d958ca
...
@@ -84,18 +84,17 @@ if [ "$1" = 'clone' ]; then
...
@@ -84,18 +84,17 @@ if [ "$1" = 'clone' ]; then
export
GIT_DIR
=
"
$VCSH_BASE
/
$VCSH_REPO_NAME
.git"
export
GIT_DIR
=
"
$VCSH_BASE
/
$VCSH_REPO_NAME
.git"
elif
[
"
$1
"
=
'delete'
]
||
elif
[
"
$1
"
=
'delete'
]
||
[
"
$1
"
=
'init'
]
||
[
"
$1
"
=
'init'
]
||
[
"
$1
"
=
'run'
]
;
then
[
"
$1
"
=
'run'
]
||
[
"
$1
"
=
'seed-gitignore'
]
;
then
[
-z
$2
]
&&
echo
"
$SELF
$1
: error: please specify repository to work on"
&&
return
1
[
-z
$2
]
&&
echo
"
$SELF
$1
: error: please specify repository to work on"
&&
return
1
[
-z
$3
]
&&
echo
"
$SELF
$1
$2
: error: please specify a command"
&&
return
1
export
VCSH_COMMAND
=
"
$1
"
export
VCSH_COMMAND
=
"
$1
"
export
VCSH_REPO_NAME
=
"
$2
"
export
VCSH_REPO_NAME
=
"
$2
"
export
GIT_DIR
=
"
$VCSH_BASE
/
$VCSH_REPO_NAME
.git"
export
GIT_DIR
=
"
$VCSH_BASE
/
$VCSH_REPO_NAME
.git"
shift
2
shift
2
export
VCSH_EXTERNAL_COMMAND
=
"
$*
"
export
VCSH_EXTERNAL_COMMAND
=
"
$*
"
elif
[
"
$1
"
=
'seed-gitignore'
]
;
then
if
[
"
$VCSH_COMMAND
"
=
'run'
]
;
then
export
VCSH_COMMAND
=
"
$1
"
[
-z
"
$VCSH_EXTERNAL_COMMAND
"
]
&&
echo
"
$SELF
$1
$2
: error: please specify a command"
&&
return
1
export
VCSH_REPO_NAME
=
"
$2
"
fi
export
GIT_DIR
=
"
$VCSH_BASE
/
$VCSH_REPO_NAME
.git"
elif
[
"
$1
"
=
'help'
]
||
elif
[
"
$1
"
=
'help'
]
||
[
"
$1
"
=
'list'
]
;
then
[
"
$1
"
=
'list'
]
;
then
export
VCSH_COMMAND
=
"
$1
"
export
VCSH_COMMAND
=
"
$1
"
...
@@ -144,7 +143,8 @@ if [ "$VCSH_COMMAND" = 'clone' ]; then
...
@@ -144,7 +143,8 @@ if [ "$VCSH_COMMAND" = 'clone' ]; then
# use || return 1
# use || return 1
verbose
"clone end"
verbose
"clone end"
elif
[
"
$VCSH_COMMAND
"
=
'help'
]
||
[
"$#"
-eq
0
]
;
then
#elif [ "$VCSH_COMMAND" = 'help' ] || [ "$#" -eq 0 ]; then
elif
[
"
$VCSH_COMMAND
"
=
'help'
]
;
then
help
help
elif
[
"
$VCSH_COMMAND
"
=
'delete'
]
;
then
elif
[
"
$VCSH_COMMAND
"
=
'delete'
]
;
then
...
@@ -221,16 +221,16 @@ elif [ "$VCSH_COMMAND" = 'seed-gitignore' ]; then
...
@@ -221,16 +221,16 @@ elif [ "$VCSH_COMMAND" = 'seed-gitignore' ]; then
for
gitignore
in
$gitignores
;
do
for
gitignore
in
$gitignores
;
do
echo
"
$gitignore
"
>>
"
$tempfile
"
echo
"
$gitignore
"
>>
"
$tempfile
"
done
done
diff
-N
"
$tempfile
"
"
$HOME
/.gitignore.d/
$
2
"
>
/dev/null
&&
diff
-N
"
$tempfile
"
"
$HOME
/.gitignore.d/
$
VCSH_REPO_NAME
"
>
/dev/null
&&
rm
-f
"
$tempfile
"
&&
rm
-f
"
$tempfile
"
&&
return
return
if
[
-e
"
$HOME
/.gitignore.d/
$
2
"
]
;
then
if
[
-e
"
$HOME
/.gitignore.d/
$
VCSH_REPO_NAME
"
]
;
then
echo
"
$SELF
: info:
$HOME
/.gitignore.d/
$
2
differs from new data, moving it to
$HOME
/.gitignore.d/
$
2
.bak"
echo
"
$SELF
: info:
$HOME
/.gitignore.d/
$
VCSH_REPO_NAME
differs from new data, moving it to
$HOME
/.gitignore.d/
$
VCSH_REPO_NAME
.bak"
mv
-f
"
$HOME
/.gitignore.d/
$
2
"
"
$HOME
/.gitignore.d/
$
2
.bak"
||
mv
-f
"
$HOME
/.gitignore.d/
$
VCSH_REPO_NAME
"
"
$HOME
/.gitignore.d/
$
VCSH_REPO_NAME
.bak"
||
(
echo
"
$SELF
: fatal: could not move
$HOME
/.gitignore.d/
$
2
to
$HOME
/.gitignore.d/
$
2
.bak"
&&
exit
1
)
(
echo
"
$SELF
: fatal: could not move
$HOME
/.gitignore.d/
$
VCSH_REPO_NAME
to
$HOME
/.gitignore.d/
$
VCSH_REPO_NAME
.bak"
&&
exit
1
)
fi
fi
mv
-f
"
$tempfile
"
"
$HOME
/.gitignore.d/
$
2
"
||
mv
-f
"
$tempfile
"
"
$HOME
/.gitignore.d/
$
VCSH_REPO_NAME
"
||
(
echo
"
$SELF
: fatal: could not move
$tempfile
to
$HOME
/.gitignore.d/
$
2
"
&&
exit
1
)
(
echo
"
$SELF
: fatal: could not move
$tempfile
to
$HOME
/.gitignore.d/
$
VCSH_REPO_NAME
"
&&
exit
1
)
cd
"
$old_dir
"
cd
"
$old_dir
"
verbose
"seed-gitignore end"
verbose
"seed-gitignore end"
...
...
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