Skip to content

Commit 56a7fde

Browse files
committed
git-gui: Revert "Don't modify CREDITS-FILE if it hasn't changed."
This reverts commit 92446ab. Too many users have complained about the credits generator in git-gui, so I'm backing the entire thing out. Signed-off-by: Shawn O. Pearce <[email protected]>
1 parent c7bafad commit 56a7fde

File tree

1 file changed

+6
-19
lines changed

1 file changed

+6
-19
lines changed

CREDITS-GEN

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ tree_search ()
2020
generate_credits ()
2121
{
2222
tip=$1 &&
23-
rm -f "$2" &&
24-
git shortlog -n -s $tip | sed 's/: .*$//' >"$2" || exit
23+
rm -f $CF &&
24+
git shortlog -n -s $tip | sed 's/: .*$//' >$CF || exit
2525
}
2626

2727
# Always use the tarball credits file if found, just
@@ -36,36 +36,23 @@ generate_credits ()
3636
# that fact.
3737
#
3838

39-
credits_tmp=/var/tmp/gitgui-credits-$$
40-
trap 'rm -f "$credits_tmp"' 0
41-
42-
orig="$credits_tmp"
43-
4439
if test -f credits
4540
then
46-
orig=credits
41+
rm -f $CF &&
42+
cp credits $CF || exit
4743
elif prefix="$(git rev-parse --show-prefix 2>/dev/null)" &&
4844
test -n "$prefix" &&
4945
head=$(git rev-list --max-count=1 HEAD -- . 2>/dev/null) &&
5046
tree=$(git rev-parse --verify "HEAD:$prefix" 2>/dev/null) &&
5147
tip=$(tree_search $head $tree) &&
5248
test -n "$tip"
5349
then
54-
generate_credits $tip "$orig" || exit
50+
generate_credits $tip || exit
5551
elif tip="$(git rev-parse --verify HEAD 2>/dev/null)" &&
5652
test -n "$tip"
5753
then
58-
generate_credits $tip "$orig" || exit
54+
generate_credits $tip || exit
5955
else
6056
echo "error: Cannot locate authorship information." >&2
6157
exit 1
6258
fi
63-
64-
if test -f "$orig" && cmp -s "$orig" "$CF"
65-
then
66-
: noop
67-
else
68-
rm -f "$CF" &&
69-
cat "$orig" >"$CF"
70-
fi
71-

0 commit comments

Comments
 (0)