Revision: 76457
          http://sourceforge.net/p/brlcad/code/76457
Author:   starseeker
Date:     2020-07-23 22:37:09 +0000 (Thu, 23 Jul 2020)
Log Message:
-----------
Make wrap width a user option

Modified Paths:
--------------
    brlcad/trunk/misc/repowork/commit.cpp
    brlcad/trunk/misc/repowork/repowork.cpp
    brlcad/trunk/misc/repowork/repowork.h

Modified: brlcad/trunk/misc/repowork/commit.cpp
===================================================================
--- brlcad/trunk/misc/repowork/commit.cpp       2020-07-23 22:24:52 UTC (rev 
76456)
+++ brlcad/trunk/misc/repowork/commit.cpp       2020-07-23 22:37:09 UTC (rev 
76457)
@@ -399,8 +399,7 @@
 std::string
 commit_msg(git_commit_data *c)
 {
-    // TODO - the width could easily be user option, and probably should be...
-    int cwidth = 72;
+    int cwidth = c->s->wrap_width;
     std::string nmsg;
 
     // Any whitespace at the end of the message, just trim it

Modified: brlcad/trunk/misc/repowork/repowork.cpp
===================================================================
--- brlcad/trunk/misc/repowork/repowork.cpp     2020-07-23 22:24:52 UTC (rev 
76456)
+++ brlcad/trunk/misc/repowork/repowork.cpp     2020-07-23 22:37:09 UTC (rev 
76457)
@@ -269,6 +269,7 @@
     std::string repo_path;
     std::string email_map;
     std::string svn_map;
+    int cwidth = 72;
 
     // TODO - might be good do have a "validate" option that does the fast 
import and then
     // checks every commit saved from the old repo in the new one...
@@ -283,6 +284,7 @@
            ("s,svn-map", "Specify svn rev -> author map (one mapping per line, 
format is commit-rev authorname)", cxxopts::value<std::vector<std::string>>(), 
"map file")
            ("t,trim-whitespace", "Trim extra spaces and end-of-line characters 
from the end of commit messages", cxxopts::value<bool>(trim_whitespace))
            ("w,wrap-commit-lines", "Wrap long commit lines to 72 cols (won't 
wrap messages already having multiple non-empty lines)", 
cxxopts::value<bool>(wrap_commit_lines))
+           ("width", "Column wrapping width (if enabled)", 
cxxopts::value<int>(), "N")
            ("h,help", "Print help")
            ;
 
@@ -312,6 +314,11 @@
            svn_map = ff[0];
        }
 
+       if (result.count("width"))
+       {
+           cwidth = result["width"].as<int>();
+       }
+
     }
     catch (const cxxopts::OptionException& e)
     {
@@ -362,6 +369,7 @@
        git_map_svn_authors(&fi_data, svn_map);
     }
 
+    fi_data.wrap_width = cwidth;
     fi_data.wrap_commit_lines = wrap_commit_lines;
     fi_data.trim_whitespace = trim_whitespace;
 

Modified: brlcad/trunk/misc/repowork/repowork.h
===================================================================
--- brlcad/trunk/misc/repowork/repowork.h       2020-07-23 22:24:52 UTC (rev 
76456)
+++ brlcad/trunk/misc/repowork/repowork.h       2020-07-23 22:37:09 UTC (rev 
76457)
@@ -128,6 +128,7 @@
 
     public:
        bool write_notes = true;
+       int  wrap_width = 72;
        bool wrap_commit_lines = false;
        bool trim_whitespace = false;
 

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.



_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to