Merge lp:~stefan.goetz-deactivatedaccount/hipl/commitguard-usability into lp:hipl
Status: | Rejected |
---|---|
Rejected by: | Stefan Götz |
Proposed branch: | lp:~stefan.goetz-deactivatedaccount/hipl/commitguard-usability |
Merge into: | lp:hipl |
Prerequisite: | lp:~stefan.goetz-deactivatedaccount/hipl/commitguard-whitespace |
Diff against target: |
91 lines (+20/-10) 4 files modified
.commitguards/author-attribution.guard (+1/-1) .commitguards/copyright-guard-space.py (+1/-1) .commitguards/copyright-year.guard (+1/-1) tools/bazaar/plugins/commitguard.py (+17/-7) |
To merge this branch: | bzr merge lp:~stefan.goetz-deactivatedaccount/hipl/commitguard-usability |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
René Hummen | Approve | ||
Diego Biurrun | Abstain | ||
Review via email: mp+89531@code.launchpad.net |
Description of the change
Improves the usability of the commitguard plugin by making its output more readable and improving the interaction with the user.
Unmerged revisions
- 6289. By Stefan Götz
-
When a file is added to a shadow repository, create it on the file system as a copy of the original
- 6288. By Stefan Götz
-
Ensure that both directory name strings in ShadowRepo do not end with a slash and make sure that the repository base directory is determined correctly
- 6287. By Stefan Götz
-
Create and delete shadow repository object, but do not use it
- 6286. By Stefan Götz
-
Add function for retrieving a patch file for the differences between the repository and the shadow repository
- 6285. By Stefan Götz
-
Add function for deleting a shadow repository
- 6284. By Stefan Götz
-
Add ShadowRepo class as infrastructure for in-place editing by commitguards
- 6283. By Stefan Götz
-
Add class definition that is part of new infrastructure for in-place editing through commitguards
- 6282. By Stefan Götz
-
Apply all commit guards to all committed files instead of aborting on the first violation
- 6281. By Stefan Götz
-
Remove the ability to apply patches printed on stderr by commit guards
- 6280. By Stefan Götz
-
Make output more readable by asking for user intervention before
displaying a potentially long diff.
review abstain
On Sat, Jan 21, 2012 at 11:38:39AM +0000, Stefan Götz wrote:
> Stefan Götz has proposed merging lp:~stefan.goetz/hipl/commitguard-usability into lp:hipl with lp:~stefan.goetz/hipl/commitguard-whitespace as a prerequisite.
This is Python, so I cannot really review. I'll trust you on it, though.
> --- .commitguards/ copyright- year.guard 2012-01-21 11:37:29 +0000 copyright- year.guard 2012-01-21 11:37:29 +0000 .(c|h|am| ac|in|py| sh|guard) $ *$CR_HOLDER" "{}" | egrep -q "\b$Y\b"; then echo "{}: The copyright statement is not up-to-date"; L=$(( $Y - 1 )); sed -r "/ Copyright \(c\) / { /\b$Y\b/ ! { /-$L / s/-$L /-$Y /; s/ $L / $L-$Y /; /\b$Y\b/ ! s/ ([0-9, -]+) ([a-zA-Z]+)/ \1, $Y \2/ } }" "{}" | diff -u "{}" - >&2; false; fi *$CR_HOLDER" "{}" | egrep -q "\b$Y\b"; then echo "The copyright statement is not up-to-date"; L=$(( $Y - 1 )); sed -r "/ Copyright \(c\) / { /\b$Y\b/ ! { /-$L / s/-$L /-$Y /; s/ $L / $L-$Y /; /\b$Y\b/ ! s/ ([0-9, -]+) ([a-zA-Z]+)/ \1, $Y \2/ } }" "{}" | diff -u "{}" - >&2; false; fi
> +++ .commitguards/
> @@ -24,4 +24,4 @@
> [guard]
> files=\
> actions=amr
> -command=CR_TOKEN=" Copyright \(c\) "; CR_HOLDER=" Aalto "; Y=$(date +%Y); if ! egrep "$CR_TOKEN.
> +command=CR_TOKEN=" Copyright \(c\) "; CR_HOLDER=" Aalto "; Y=$(date +%Y); if ! egrep "$CR_TOKEN.
Maybe you could break this sequence of commands:
> +command=CR_TOKEN=" Copyright \(c\) ";
CR_HOLDER= " Aalto ";
Y=$(date +%Y);
if ! egrep "$CR_TOKEN. *$CR_HOLDER" "{}" | egrep -q "\b$Y\b"; then
echo "The copyright statement is not up-to-date";
L= $(( $Y - 1 ));
sed -r "/ Copyright \(c\) / { /\b$Y\b/ ! { /-$L / s/-$L /-$Y /; s/ $L / $L-$Y /; /\b$Y\b/ ! s/ ([0-9, -]+) ([a-zA-Z]+)/ \1, $Y \2/ } }" "{}" | diff -u "{}" - >&2;
false;
fi
This might even work if the ';' are replaced by '\'. :)
Diego