[OS-BUILD PATCHv5 3/26] [redhat] egit.sh initial commit

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

 



From: Ben Crocker <bcrocker@xxxxxxxxxx>

This is a sample script providing a thin layer over the git command.
It is meant to substitute in redhat/Makefile and Makefile.common via the
GIT macro defined in Makefile.

Each git subcommand currently used by Makefile and Makefile.common is
broken out into its own case.  At the moment, the output of either
'git describe' or 'git merge-base' can be overridden by means of
environment variables, EGIT_OVERRIDE_DESCRIBE and
EGIT_OVERRIDE_MERGE_BASE respectively.

Use case: self test with test values for 'git describe' and/or 'git merge-base'.

Other git subcommands are simply passed through.

Signed-off-by: Ben Crocker <bcrocker@xxxxxxxxxx>
---
 redhat/egit.sh | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 60 insertions(+)
 create mode 100755 redhat/egit.sh

diff --git a/redhat/egit.sh b/redhat/egit.sh
new file mode 100755
index 000000000000..e8d7f7390d8a
--- /dev/null
+++ b/redhat/egit.sh
@@ -0,0 +1,60 @@
+#!/bin/bash
+
+arg=$1
+shift
+case $arg in
+    add )
+        git add "$@"
+        ;;
+    branch )
+        git branch "$@"
+        ;;
+    commit )
+        git commit "$@"
+        ;;
+    config )
+        git config "$@"
+        ;;
+    describe )
+        if [ -n "$EGIT_OVERRIDE_DESCRIBE" ]
+        then
+            # Should be a version, e.g. v5.9-rc8 or v5.9-rc7-1449-g57b6fb86b0ac
+            echo "$EGIT_OVERRIDE_DESCRIBE"
+        else
+            git describe "$@"
+        fi
+        ;;
+    diff )
+        git diff "$@"
+        ;;
+    diff-index )
+        git diff-index "$@"
+        ;;
+    log )
+        git log "$@"
+        ;;
+    merge-base )
+        if [ -n "$EGIT_OVERRIDE_MERGE_BASE" ]
+        then
+            # This should be an SHA1:
+            echo "$EGIT_OVERRIDE_MERGE_BASE"
+        else
+            git merge-base "$@"
+        fi
+        ;;
+    rev-parse )
+        git rev-parse "$@"
+        ;;
+    show )
+        git show "$@"
+        ;;
+    tag )
+        git tag "$@"
+        ;;
+    remote )
+        git remote "$@"
+        ;;
+    * )
+        git "$arg" "$@"
+        ;;
+esac
-- 
GitLab
_______________________________________________
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




[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