Skip to main content
Homepage
Explore
Search or go to…
/
Sign in
Explore
Primary navigation
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
?
Collapse sidebar
Snippets
Groups
Projects
Show more breadcrumbs
Kevin Lyda
vcsh
Commits
8b65faf2
Commit
8b65faf2
authored
Nov 19, 2011
by
Richard Hartmann
Browse files
Options
Downloads
Patches
Plain Diff
Make `vcsh seed-gitignore` independent of $PWD
parent
e11ef008
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
+10
-5
10 additions, 5 deletions
vcsh
with
10 additions
and
5 deletions
vcsh
+
10
−
5
View file @
8b65faf2
...
@@ -180,6 +180,10 @@ elif [ "$1" = 'seed-gitignore' ]; then
...
@@ -180,6 +180,10 @@ elif [ "$1" = 'seed-gitignore' ]; then
verbose
"seed-gitignore begin"
verbose
"seed-gitignore begin"
[
-z
$2
]
&&
help
&&
echo
&&
echo
"
$SELF
$1
: error: please specify repository to work on"
&&
return
0
[
-z
$2
]
&&
help
&&
echo
&&
echo
"
$SELF
$1
: error: please specify repository to work on"
&&
return
0
use
"
$2
"
use
"
$2
"
# Switching directory as this has to be executed from $HOME to be of any use.
# Going back into old directory at the end in case `vcsh use` is reactivated.
old_dir
=
"
$PWD
"
cd
"
$HOME
"
git config core.excludesfile
".gitignore.d/
$REPO_NAME
"
git config core.excludesfile
".gitignore.d/
$REPO_NAME
"
files
=
$(
git ls-files
)
files
=
$(
git ls-files
)
gitignores
=
$(
for
file
in
$(
git ls-files
)
;
do
gitignores
=
$(
for
file
in
$(
git ls-files
)
;
do
...
@@ -189,13 +193,14 @@ elif [ "$1" = 'seed-gitignore' ]; then
...
@@ -189,13 +193,14 @@ elif [ "$1" = 'seed-gitignore' ]; then
file
=
"
$new
"
file
=
"
$new
"
done
;
done
;
done
|
sort
-u
|
sed
's/^/!/'
)
done
|
sort
-u
|
sed
's/^/!/'
)
[
-e
.gitignore.d/
$2
]
&&
[
-e
"
$HOME
/
.gitignore.d/
$2
"
]
&&
echo
"
$SELF
: info: .gitignore.d/
$2
exists, moving it to .gitignore.d/
$2
.bak"
&&
echo
"
$SELF
: info:
$HOME
/
.gitignore.d/
$2
exists, moving it to
$HOME
/
.gitignore.d/
$2
.bak"
&&
mv
-f
.gitignore.d/
$2
.gitignore.d/
$2
.bak
mv
-f
"
$HOME
/
.gitignore.d/
$2
"
"
$HOME
/
.gitignore.d/
$2
.bak
"
echo
'*'
>
.gitignore.d/
$2
echo
'*'
>
"
$HOME
/
.gitignore.d/
$2
"
for
gitignore
in
$gitignores
;
do
for
gitignore
in
$gitignores
;
do
echo
$gitignore
>>
.gitignore.d/
$2
echo
"
$gitignore
"
>>
"
$HOME
/
.gitignore.d/
$2
"
done
done
cd
"
$old_dir
"
else
else
verbose
"defaulting to calling help()"
verbose
"defaulting to calling help()"
...
...
...
...
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
sign in
to comment