[OS-BUILD PATCH] [redhat] process_configs.sh: include config commit

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Scott Weaver <scweaver@xxxxxxxxxx>

[redhat] process_configs.sh: include config commit

This adds a comment to the pending config file that documents the commit
where the new config was defined.  This is based on the "Defined at"
line provided by the helpnewconfig make target.

Signed-off-by: Scott Weaver <scweaver@xxxxxxxxxx>

diff --git a/redhat/configs/process_configs.sh b/redhat/configs/process_configs.sh
index blahblah..blahblah 100755
--- a/redhat/configs/process_configs.sh
+++ b/redhat/configs/process_configs.sh
@@ -148,7 +148,8 @@ parsenewconfigs()
         /usr/bin/awk -v BASE="$tmpdir" '
                 BEGIN { inpatch=0;
 			outfile="none";
-                        symbol="none"; }
+                        symbol="none";
+                        commit=""; }
                 /^Symbol: .*$/ {
                         split($0, a, " ");
                         symbol="CONFIG_"a[2];
@@ -160,9 +161,11 @@ parsenewconfigs()
 			}
                         else {
                                 if (symbol != "none") {
+                                    print "# Commit: "commit >> outfile
                                     system("cat " outfile " " BASE "/" symbol " > " BASE "/tmpf");
                                     system("mv " BASE "/tmpf " BASE "/" symbol);
                                     symbol="none"
+                                    commit=""
 				}
                                 outfile="none"
 				inpatch = 0;
@@ -173,6 +176,15 @@ parsenewconfigs()
                                 print "# "$0 >> outfile;
                         }
                 }
+                /^Defined at .*$/ {
+                        split($0, x, " ");
+                        filenum=x[3];
+                        split(filenum, x, ":");
+                        file=x[1]
+                        line=x[2]
+                        cmd="git blame -L " line "," line " " file " | cut -d \" \" -f1 | xargs git log --pretty=format:\"%C(auto)%h %C(cyan)('%s')\" -1"
+                        cmd | getline commit
+                }
 
 
         ' .helpnewconfig

--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2923
--
_______________________________________________
kernel mailing list -- kernel@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to kernel-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/kernel@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue




[Index of Archives]     [Fedora General Discussion]     [Older Fedora Users Archive]     [Fedora Advisory Board]     [Fedora Security]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Mentors]     [Fedora Package Announce]     [Fedora Package Review]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Coolkey]     [Yum Users]     [Tux]     [Yosemite News]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [USB]     [Asterisk PBX]

  Powered by Linux