%%
%% This is file `tudscr-gitinfo.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% tudscr-version.dtx  (with options: `package,git,identify')
%% tudscr-gitinfo.dtx  (with options: `identify,package')
%% 
%% TUD-Script -- Corporate Design of Technische Universitaet Dresden
%%               2022/08/09 v2.06o TUD-Script
%% 
%% Copyright (C) Falk Hanisch <hanisch.latex@outlook.com>, 2012-2022
%%               https://github.com/tud-cd/tudscr
%%               https://latex.wcms-file3.tu-dresden.de/phpBB3/
%% 
%% This file was generated from file(s) of the TUD-Script bundle.
%% ----------------------------------------------------------------------------
%% 
%% This work may be distributed and/or modified under the conditions of the
%% LaTeX Project Public License, either version 1.3c of this license or
%% any later version. The latest version of this license is in
%%   http://www.latex-project.org/lppl.txt
%% and version 1.3c or later is part of all distributions of
%% LaTeX version 2008-05-04 or later.
%% 
%% This work has the LPPL maintenance status "maintained".
%% 
%% The current maintainer and author of this work is Falk Hanisch.
%% 
%%%% From File: tudscr-version.dtx (no git version info was found)
\NeedsTeXFormat{LaTeX2e}[2022-06-01]
\begingroup
  \catcode`\@11\relax%
  \ifx\TUD@Version\@undefined%
    \newcommand*\TUD@@Version[2]{%
      \gdef\TUD@Version{#1}%
      \gdef\TUD@KOMAVersion{#2}%
    }%
  \else%
    \newcommand*\TUD@@Version[2]{%
      \def\@tempa{#1}%
      \ifx\TUD@Version\@tempa\else%
        \@latex@warning@no@line{%
          \noexpand\TUD@Version\space is `\TUD@Version',\MessageBreak%
          but `#1' was expected!\MessageBreak%
          You should not use classes, packages or files from\MessageBreak%
          different TUD-Script bundle versions%
        }%
      \fi%
    }%
  \fi%
  \TUD@@Version{2022/08/09 v2.06o TUD-Script}{2022/05/01 v3.36 KOMA-Script}%
  \ifx\TUDScriptVersion\@undefined%
    \xdef\TUDScriptVersion{\TUD@Version}%
    \def\@tempa#1 v#2 #3\relax#4\relax#5{\gdef#5{#2}}%
    \expandafter\@tempa\TUD@Version ? ?\relax\relax{\TUDScriptVersionNumber}%
    \expandafter\@tempa\TUD@KOMAVersion ? ?\relax\relax{\TUD@KOMAVersionNumber}%
  \fi%
\endgroup
\@ifundefined{TUDScript}{%
  \DeclareRobustCommand\TUDScript{%
    \mbox{%
      \textsf{%
        T\kern.05em U\kern.05em D\kern.1em-\kern.1em Script%
      }%
    }\ifcsname xspace\endcsname\xspace\fi%
  }%
}{}
\providecommand*\TUDScriptContact{hanisch.latex@outlook.com}
\providecommand*\TUDScriptRepository{https://github.com/tud-cd/tudscr}
\providecommand*\TUDScriptForum{https://latex.wcms-file3.tu-dresden.de/phpBB3/}
%%%% From File: tudscr-gitinfo.dtx (no git version info was found)
\def\GitContainerFile{tudscr-gitinfo-ver.aux}
\ProvidesPackage{tudscr-gitinfo}[%
  2022/08/09 v2.06o TUD-Script
  package (obtaining git version)%
]
\ifcsname ver@\GitContainerFile\endcsname\else
  \InputIfFileExists{\GitContainerFile}{}{}%
\fi
\def\GetFileInfo{\tud@GetFileInfo}
\newcommand*\tud@git@file@list{}
\newcommand*\tud@GetFileInfo[1]{%
  \filename@parse{#1}%
  \ifx\filename@ext\relax%
    \edef\filename{\filename@area\filename@base.dtx}%
    \expandafter\IfFileExists\expandafter{\filename}{}{%
      \edef\filename{\filename@area\filename@base.tex}%
    }%
  \else%
    \edef\filename{#1}%
  \fi%
  \expandafter\tud@git@log\expandafter{\filename}%
  \ifcsname\filename-ver\endcsname%
    \def\@tempa##1 ##2 ##3\@nil{%
      \def\filedate{##1}%
      \let\fileversion\@empty%
      \def\filerevision{##3}%
    }%
    \edef\@tempb{\csname\filename-ver\endcsname}%
    \expandafter\@tempa\@tempb\@nil%
    \let\fileinfo\@empty%
    \edef\tud@git@file@list{\tud@git@file@list,\filename}%
  \else%
    \PackageWarningNoLine{tudscr-gitinfo}{No git info found for \filename}%
    \expandafter\tud@@GetFileInfo\expandafter{\filename}%
  \fi%
}
\newcommand*\tud@@GetFileInfo[1]{%
  \@ifundefined{filedate}{\def\filedate{?}}{}%
  \@ifundefined{fileversion}{\def\fileversion{?}}{}%
  \@ifundefined{filerevision}{\let\filerevision\@empty}{}%
  \@ifundefined{fileinfo}{\let\fileinfo\@empty}{}%
  \ifcsname ver@\filename\endcsname%
    \def\@tempa##1 ##2 ##3\relax##4\relax{%
      \def\@tempb####1\relax?####2\@nil{\edef\@tempc{####1}}%
      \@tempb##1\relax?\@nil%
      \ifx\@tempc\@empty\else%
        \let\filedate\@tempc%
        \@tempb##2\relax?\@nil%
        \ifx\@tempc\@empty\else%
          \let\fileversion\@tempc%
          \@tempb##3\relax?\@nil%
          \ifx\@tempc\@empty\else%
            \let\fileinfo\@tempc%
          \fi%
        \fi%
      \fi%
    }%
    \edef\@tempb{\csname ver@#1\endcsname}%
    \expandafter\@tempa\@tempb\relax? ? \relax\relax%
  \fi%
}
\RequirePackage{scrlfile}[%
  2022/05/01 v3.36 KOMA-Script
]
\AfterPackage*{doc}{\def\GetFileInfo{\tud@GetFileInfo}}
\RequirePackage{pdftexcmds}
\newcommand*\tud@git@log[1]{%
  \ifnum\pdf@shellescape=\@ne%
    \begingroup%
      \endlinechar=\m@ne%
      \everyeof{\noexpand}%
      \edef\@tempa{\tud@git@@log{#1}}%
      \ifx\@tempa\@empty\else%
        \edef\@tempa{%
          \unexpanded{\expandafter\gdef\csname #1-ver\endcsname}{\@tempa}%
        }%
        \@tempa%
      \fi%
    \endgroup%
  \fi%
}
\begingroup
\@makeother\|
\newcommand*\tud@git@@log[1]{}
\xdef\tud@git@@log#1{%
  \noexpand\@@input|"git log -1 %
    --format='\@percentchar ad \@percentchar h' %
    --date=format:'\@percentchar Y/\@percentchar m/\@percentchar d %
      \@percentchar H:\@percentchar M:\@percentchar S' %
    -- #1" %
}
\endgroup
\AtEndDocument{%
  \ifnum\pdf@shellescape=\@ne%
    \ifx\tud@git@file@list\@empty\else%
      \edef\tud@git@file@list{\expandafter\@gobble\tud@git@file@list}%
      \def\@tempa{%
        \@percentchar\@percentchar\space%
        This file was generated with `tudscr-gitinfo.sty'^^J%
        \@percentchar\@percentchar\space%
        It is intended to be used for generating either a documentation^^J%
        \@percentchar\@percentchar\space%
        with class `tudscrdoc' or installation files with `docstrip'%
      }%
      \chardef\reserved@c15 %
      \ch@ck7\reserved@c\write%
      \immediate\openout\reserved@c\GitContainerFile\relax%
      \immediate\write\reserved@c{\@tempa}%
      \@for\@tempa:=\tud@git@file@list\do{%
        \edef\@tempb{%
          \unexpanded{\expandafter\gdef\csname}%
          \@tempa-ver%
          \noexpand\endcsname%
          {\csname\@tempa-ver\endcsname}%
        }%
        \immediate\write\reserved@c{\unexpanded\expandafter{\@tempb}}%
      }%
      \immediate\closeout\reserved@c%
    \fi%
  \fi%
}
\AtEndOfPackage{%
  \GetFileInfo{\jobname}%
  \edef\@tempa{%
    \filedate\space\fileversion\space%
    \ifx\filerevision\@empty\else%
      \filerevision\ifx\fileinfo\@empty\else\space\fi%
    \fi%
    \fileinfo%
  }%
  \ifcsname ver@\filename\endcsname%
    \edef\@tempb{\csname ver@\filename\endcsname}%
    \ifx\@tempb\filedate\else%
      \PackageWarningNoLine{tudscr-gitinfo}{%
        The obtained info for \filename\space is\MessageBreak%
        \@tempa\MessageBreak%
        so the current info\MessageBreak%
        \csname ver@\filename\endcsname\MessageBreak%
        is overwritten%
      }%
    \fi%
  \fi%
  \ProvidesFile{\filename}[\@tempa]%
}
\endinput
%%
%% End of file `tudscr-gitinfo.sty'.
