Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-common
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
Core Modules
dune-common
Commits
ba3927f8
Commit
ba3927f8
authored
11 years ago
by
Markus Blatt
Browse files
Options
Downloads
Patches
Plain Diff
[dunecontrol] Adds git command support.
parent
3cc3284e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bin/dunecontrol
+34
-7
34 additions, 7 deletions
bin/dunecontrol
with
34 additions
and
7 deletions
bin/dunecontrol
+
34
−
7
View file @
ba3927f8
...
...
@@ -221,7 +221,7 @@ esac'
}
# list of all dunecontrol commands
COMMANDS
=
"printdeps vcsetup update autogen configure make all exec bexec status svn"
COMMANDS
=
"printdeps vcsetup update autogen configure make all exec bexec status svn
git
"
# help string for the commands
printdeps_HELP
=
"print recursive dependencies of a module"
...
...
@@ -235,6 +235,7 @@ exec_HELP="execute an arbitrary command in each module source directory"
bexec_HELP
=
"execute an arbitrary command in each module build directory"
status_HELP
=
"show vc status for all modules"
svn_HELP
=
"
\t
run svn command for each svn managed module"
git_HELP
=
"
\t
run git command for each svn managed module"
#
# setup command proxies
...
...
@@ -263,6 +264,17 @@ run_default_bexec () {
run_default_status
()
{
local
verbose
=
0
local
update
=
""
local
is_git
=
""
local
is_svn
=
""
name
=
"
$(
eval echo
\$
NAME_
$module
)
"
if
test
-d
.git
;
then
is_git
=
1
;
fi
if
test
-d
.svn
;
then
is_svn
=
1
;
fi
if
test
!
"
$is_svn
"
-a
!
"
$is_git
"
;
then
echo
"module
$name
not under known version control"
return
fi
for
i
in
$CMD_FLAGS
;
do
if
eval test
"x
$i
"
=
"x-v"
;
then
verbose
=
1
;
fi
if
eval test
"x
$i
"
=
"x-vv"
;
then
verbose
=
2
;
fi
...
...
@@ -277,16 +289,24 @@ run_default_status () {
fi
if
test
$verbose
-eq
1
;
then
svn status
$update
|
grep
-E
"^M|^A|^D|^C|^U"
test
"
$is_svn
"
&&
svn status
$update
|
grep
-E
"^M|^A|^D|^C|^U"
test
"
$is_git
"
&&
git status
-uno
elif
test
$verbose
-eq
2
;
then
svn status
$update
test
"
$is_svn
"
&&
svn status
$update
test
"
$is_git
"
&&
git status
fi
name
=
"
$(
eval echo
\$
NAME_
$module
)
"
changed
=
$(
svn status |
grep
-E
"^M|^A|^D"
|
wc
-l
)
collisions
=
$(
svn status |
grep
-E
"^C"
|
wc
-l
)
pending
=
$(
svn status
$update
|
grep
-E
"^......
\*
"
|
wc
-l
)
if
test
"
$is_svn
"
;
then
changed
=
$(
svn status |
grep
-E
"^M|^A|^D"
|
wc
-l
)
collisions
=
$(
svn status |
grep
-E
"^C"
|
wc
-l
)
pending
=
$(
svn status
$update
|
grep
-E
"^......
\*
"
|
wc
-l
)
fi
if
test
"
$is_git
"
;
then
changed
=
$(
git status
--porcelain
|
grep
-E
"^ *M|^ *A|^ *D|^ *R|^ *C"
|
wc
-l
)
collisions
=
$(
git status
--porcelain
|
grep
-E
"^ *U"
|
wc
-l
)
pending
=
$(
git status |
grep
-E
"^
\#
Your branch is ahead of "
|
wc
-l
)
fi
color
=
$green
text
=
"no changes"
if
[
$changed
-eq
0
]
;
then
...
...
@@ -602,6 +622,13 @@ run_default_svn () {
fi
}
run_default_git
()
{
if
test
-d
.git
;
then
PARAMS
=
"
$CMD_FLAGS
"
eval
git
"
$PARAMS
"
fi
}
###############################################
###
### main
...
...
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