@matheusbsbs / matheus-bagliano / commits / 56a7fde16e
Fork 0

git-gui: Revert "Don't modify CREDITS-FILE if it hasn't changed." This reverts commit 92446aba47b0e0db28f7b858ea387efcca30ab44.

git-gui: Revert "Don't modify CREDITS-FILE if it hasn't changed." This reverts commit 92446aba47b0e0db28f7b858ea387efcca30ab44. 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 <spearce@spearce.org>

Shawn O. Pearce committed Mar 12, 2007 at 13:25 UTC 56a7fde16ed060bc4169cc78308f8cf10f1d92a8
1 file changed +6 -19
CREDITS-GEN
+6 -19
@@ -20,8 +20,8 @@ tree_search ()
20 generate_credits ()
21 {
22 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
25 }
26
27 # Always use the tarball credits file if found, just
@@ -36,14 +36,10 @@ generate_credits ()
36 # that fact.
37 #
38
39 -credits_tmp=/var/tmp/gitgui-credits-$$
40 -trap 'rm -f "$credits_tmp"' 0
41 -
42 -orig="$credits_tmp"
43 -
39 if test -f credits
40 then
46 - orig=credits
41 + rm -f $CF &&
42 + cp credits $CF || exit
43 elif prefix="$(git rev-parse --show-prefix 2>/dev/null)" &&
44 test -n "$prefix" &&
45 head=$(git rev-list --max-count=1 HEAD -- . 2>/dev/null) &&
@@ -51,21 +47,12 @@ elif prefix="$(git rev-parse --show-prefix 2>/dev/null)" &&
47 tip=$(tree_search $head $tree) &&
48 test -n "$tip"
49 then
54 - generate_credits $tip "$orig" || exit
50 + generate_credits $tip || exit
51 elif tip="$(git rev-parse --verify HEAD 2>/dev/null)" &&
52 test -n "$tip"
53 then
58 - generate_credits $tip "$orig" || exit
54 + generate_credits $tip || exit
55 else
56 echo "error: Cannot locate authorship information." >&2
57 exit 1
58 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 -