Bug 13734 - svn-create-patch could check for most obvious mistakes in patches
Summary: svn-create-patch could check for most obvious mistakes in patches
Status: RESOLVED CONFIGURATION CHANGED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 523.x (Safari 3)
Hardware: PC OS X 10.4
: P3 Enhancement
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-05-15 11:06 PDT by Kimmo Kinnunen
Modified: 2021-03-15 03:27 PDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kimmo Kinnunen 2007-05-15 11:06:53 PDT
The svn-create-patch chould check for the most obvious mistakes in the patches it creates. The tool could for example warn the author for the mistakes.

A warning could be printed on at least following mistakes:
- Tabs present in the modifications
- Modifying files in a directory which would require ChangeLog entry
Comment 1 Kimmo Kinnunen 2007-05-15 11:24:03 PDT
I don't know if it'd be useful to others, but I'll probably save following locally:

Index: WebKitTools/Scripts/svn-create-patch
===================================================================
--- WebKitTools/Scripts/svn-create-patch        (revision 21458)
+++ WebKitTools/Scripts/svn-create-patch        (working copy)
@@ -228,6 +228,10 @@ sub generateDiff($$$)
     close DIFF;
     $patch = fixChangeLogPatch($patch) if basename($file) eq "ChangeLog";
     print $patch if $patch;
+    if ($patch =~ /^\+(\t|!\+.*\t)/mg ) {
+        print STDERR "Warning: changes in file '$file' contain tab characters.\n";
+    }
+
     if ($isBinary) {
         print "\n" if ($patch && $patch =~ m/\n\S+$/m);
         outputBinaryContent($file);
Comment 2 David Kilzer (:ddkilzer) 2007-05-15 22:45:06 PDT
Yes, that does make sense!