Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
a42453a5
Commit
a42453a5
authored
May 18, 2010
by
antirez
Browse files
use git diff when generating release.h to check for dirty status
parent
9caf1a20
Changes
1
Show whitespace changes
Inline
Side-by-side
mkreleasehdr.sh
View file @
a42453a5
#!/bin/sh
#!/bin/sh
GIT_SHA1
=
$((
git show-ref
--
head
--
hash
=
8
2
>
/
dev/null
||
echo
00000000
)
|
head
-
n1
)
GIT_SHA1
=
$((
git show-ref
--
head
--
hash
=
8
2
>
/
dev/null
||
echo
00000000
)
|
head
-
n1
)
GIT_DIRTY
=
$(
git
status
-s
2> /dev/null |
wc
-l
)
GIT_DIRTY
=
$(
git
diff
2> /dev/null |
wc
-l
)
test
-
f release.h
||
touch
release.h
test
-
f release.h
||
touch
release.h
(
cat
release.h
|
grep
SHA1
|
grep
$GIT_SHA1
)
&&
\
(
cat
release.h
|
grep
SHA1
|
grep
$GIT_SHA1
)
&&
\
(
cat
release.h
|
grep
DIRTY
|
grep
$GIT_DIRTY
)
&&
exit
0
# Already uptodate
(
cat
release.h
|
grep
DIRTY
|
grep
$GIT_DIRTY
)
&&
exit
0
# Already uptodate
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment