Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add git version info for parent commits (#597) #598

Merged
merged 32 commits into from
Jan 25, 2024

Commits on Jan 4, 2024

  1. Add test TribitsHelloWorld_config_git_version (#597)

    Added test TribitsHelloWorld_config_git_version that uses mockprogram.py as
    git to generate and check git version info.
    
    ToDo: We should also check the generated TribitsHelloWorldRepoVersion.txt file
    bartlettroscoe committed Jan 4, 2024
    Configuration menu
    Copy the full SHA
    00b3c6f View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    80191d4 View commit details
    Browse the repository at this point in the history
  3. Strip the whitespace from git command (#597)

    For some reason, mockprogram.py prints an newline that raw git does not.  But
    this should work for raw git too.
    bartlettroscoe committed Jan 4, 2024
    Configuration menu
    Copy the full SHA
    98750bb View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    1db9378 View commit details
    Browse the repository at this point in the history

Commits on Jan 12, 2024

  1. Renamed test TribitsHelloWorld_config_git_version (#597)

    Renamed the test TribitsHelloWorld_config_git_version to TribitsHelloWorld_config_git_version_single_repo_one_parent
    to correctly state the scope of the test and allow for future similar tests with slightly a difference scopes
    (such as single_repo_two_parents, multi_repo_one_parent, etc).
    achauphan committed Jan 12, 2024
    Configuration menu
    Copy the full SHA
    ebd6c6f View commit details
    Browse the repository at this point in the history
  2. Refactored chunk of tribits_generate_single_repo_version_string for r…

    …euse (#597)
    
    Moved git commit info functionality of tribits_generate_single_repo_version_string to
    a separate helper function named tribites_generate_commit_info_string. The core functionality and
    output is the same. This is in prep for reuse of that functionality inside of the original
    tribits_generate_single_repo_version string.
    achauphan committed Jan 12, 2024
    Configuration menu
    Copy the full SHA
    b35e3c9 View commit details
    Browse the repository at this point in the history
  3. Removed trailing whitespace for tribits_git_repo_sha1 git cmnd output (

    …#597)
    
    Removed trailing whitespace to keep git command outputs consistent with other
    functions performing git commands and for the output to be more processable.
    achauphan committed Jan 12, 2024
    Configuration menu
    Copy the full SHA
    8966263 View commit details
    Browse the repository at this point in the history
  4. Add commit sha1 input for tribits_generate_commit_info_string (#597)

    Make tribits_generate_commit_info_string output commit info based on a passed in
    commit sha1.
    achauphan committed Jan 12, 2024
    Configuration menu
    Copy the full SHA
    fd3a2e9 View commit details
    Browse the repository at this point in the history
  5. Updated TribitsHelloWorld_config_git_version_single_repo_one_parent t…

    …est (#597)
    
    Updated mockprogram inputs and outputs to be more specific about which
    commit message is being outputted.
    achauphan committed Jan 12, 2024
    Configuration menu
    Copy the full SHA
    be3a494 View commit details
    Browse the repository at this point in the history

Commits on Jan 13, 2024

  1. Added git version info for parent commits (#597)

    If the HEAD sha1 contains more than one parent, include each parent's
    commit info in the final repoVersionStringOut of tribits_generate_single_repo_version_string.
    achauphan committed Jan 13, 2024
    Configuration menu
    Copy the full SHA
    0dacf47 View commit details
    Browse the repository at this point in the history
  2. Added double quotes around variable (#597)

    Forgot to double quote variable and caused configure failures during Github Actions testing.
    achauphan committed Jan 13, 2024
    Configuration menu
    Copy the full SHA
    f34a429 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    3af75e3 View commit details
    Browse the repository at this point in the history

Commits on Jan 16, 2024

  1. Added global cmake cache var to show git commit parents (#597)

    Added global cmake cache variable `<PROJECT_NAME>_SHOW_GIT_COMMIT_PARENTS:BOOL`
    that is default to OFF. This will be a project based variable to including
    parent commit info in the repo version output.
    achauphan committed Jan 16, 2024
    Configuration menu
    Copy the full SHA
    a40bd5e View commit details
    Browse the repository at this point in the history
  2. Cleaned up git log and cmake command argument formatting (#597)

    Reordered git log arguments to the expected order as well as condensed
    cmake command arguments into a single line.
    achauphan committed Jan 16, 2024
    Configuration menu
    Copy the full SHA
    592ea0d View commit details
    Browse the repository at this point in the history
  3. Updated tribits_gernerate_single_repo_version_string to use HEAD (#597)

    Instead of passing in the deferenced HEAD SHA1 to tribites_generate_commit_info_string,
    simply just pass in the HEAD pointer keyword for Git to deference itself.
    achauphan committed Jan 16, 2024
    Configuration menu
    Copy the full SHA
    e4b19b6 View commit details
    Browse the repository at this point in the history
  4. Updated to use cmake string(REGEX REPLACE) when converting git log ou…

    …tput (#597)
    
    In the off chance that Git decides to change the output of git log -1 "--pretty=format:%p",
    use a regex match and replace in cmake to match consecutive spaces and replace them with a
    single ;.
    achauphan committed Jan 16, 2024
    Configuration menu
    Copy the full SHA
    852e651 View commit details
    Browse the repository at this point in the history
  5. Simplified loop and changed to 1-based indexing (#597)

    Simplified foreach loop in tribits_generate_single_repo_version_string and changed
    the parent indexing to be 1-based instead of 0-based.
    achauphan committed Jan 16, 2024
    Configuration menu
    Copy the full SHA
    f6b6442 View commit details
    Browse the repository at this point in the history

Commits on Jan 24, 2024

  1. Implemented -DPROJECT_NAME_SHOW_GIT_COMMIT_PARENTS option (#597)

    Implemented usage of previously added global cmake variable,
    `PROJECT_NAME_SHOW_GIT_COMMIT_PARENTS` in `tribits_generate_single_repo_version_string`.
    
    This is done with an optional argument named INCLUDE_COMMIT_PARENTS whenever
    calling `tribits_generate_single_repo_version_string`
    achauphan authored and bartlettroscoe committed Jan 24, 2024
    Configuration menu
    Copy the full SHA
    1e5e09e View commit details
    Browse the repository at this point in the history
  2. Reorder functions according to clean code ordering (#597)

    With Clean Code ordering (i.e. the Newspaper Metaphor), in general, the
    functions should be ordered from top-level to low-level in the calling order.
    That is, the functions that are called in a given function should be listed
    below that function.
    bartlettroscoe committed Jan 24, 2024
    Configuration menu
    Copy the full SHA
    de652b7 View commit details
    Browse the repository at this point in the history
  3. Cleaned up empty lines (#597)

    Cleaned up empty lines in `TribitsHelloWorld_Tests.cmake`
    achauphan authored and bartlettroscoe committed Jan 24, 2024
    Configuration menu
    Copy the full SHA
    ba7e8da View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    628b27e View commit details
    Browse the repository at this point in the history
  5. Switch to one_value_keywords for INCLUDE_COMMIT_PARENTS (#597)

    This allows the calling code to be more compact.  Since this function is not
    really called by any external users (perhaps ever), this seems like a good
    trade-off.
    bartlettroscoe committed Jan 24, 2024
    Configuration menu
    Copy the full SHA
    ce4728b View commit details
    Browse the repository at this point in the history
  6. Speed up Git version info test by setting <Project>_TRACE_DEPENDENCY_…

    …HANDLING_ONLY=ON (#597)
    
    This spead up these tests on my machine 'crf450' from about 3.4 sec to about
    0.45 sec.
    
    We don't need to enable the compilers and process the package CMakeLists.txt
    files to test this version info.
    bartlettroscoe committed Jan 24, 2024
    Configuration menu
    Copy the full SHA
    1548b6f View commit details
    Browse the repository at this point in the history
  7. Document <Project>_TRACE_DEPENDENCY_HANDLING_ONLY (#597)

    This is a variable that project developers and users should know about.
    bartlettroscoe committed Jan 24, 2024
    Configuration menu
    Copy the full SHA
    3aa1ea8 View commit details
    Browse the repository at this point in the history
  8. Refactor tribits_generate_repo_version_file_string() naming and clean…

    …up (#597)
    
    Using camelCase for local vars helps to differentiate from UPPER_CACHE vars for
    function argument keywords and global vars.
    
    I figured I would clean this function up while I was working on it.
    
    Now this fits in one screen-shot for me.
    bartlettroscoe committed Jan 24, 2024
    Configuration menu
    Copy the full SHA
    b9e7d10 View commit details
    Browse the repository at this point in the history
  9. Move TribitsGitRepoVersionInfo.cmake from core/package_arch/ to core/…

    …utils/ (#597)
    
    I noticed that this module does not depend on the TriBITS framework in any way
    so it should live under the core/utils/ directory to make that clear and to
    allow easy reuse in non-TriBITS projects that would like to use it.
    bartlettroscoe committed Jan 24, 2024
    Configuration menu
    Copy the full SHA
    e30b76e View commit details
    Browse the repository at this point in the history
  10. Use tribits_advanced_set_cache_var_and_default() for <Project>_SHOW_G…

    …IT_COMMIT_PARENTS (#597)
    
    We eventually need to use this for all of those vars to make that code more
    compact.
    bartlettroscoe committed Jan 24, 2024
    Configuration menu
    Copy the full SHA
    3bed1f9 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    ba27309 View commit details
    Browse the repository at this point in the history
  12. Fix some typos in tribits_ctest_driver() (#597)

    I noticed this while looking at the documentation while working on #597.
    bartlettroscoe committed Jan 24, 2024
    Configuration menu
    Copy the full SHA
    731841e View commit details
    Browse the repository at this point in the history
  13. Set -DTribitsExMetaProj_SHOW_GIT_COMMIT_PARENTS=ON for multi-repo test (

    #597)
    
    This sets the option:
    
      -DTribitsExMetaProj_SHOW_GIT_COMMIT_PARENTS=ON
    
    in the inner CMake configuration with a multi-repo setup so we can test the
    extraction and printing of the parent commit info.  This tests a call of the
    function tribits_generate_single_repo_version_string() for extra repos from
    the function tribits_generate_repo_version_file_string().  This test also
    validates that the correct Git commands are called since this uses real Git on
    a Git repos.
    
    The downside of this updated test is that it makes it a little more difficult
    to maintain these tests when we have to update these snapshotted Git repos.
    bartlettroscoe committed Jan 24, 2024
    Configuration menu
    Copy the full SHA
    548a0b9 View commit details
    Browse the repository at this point in the history

Commits on Jan 25, 2024

  1. Merge pull request #601 from bartlettroscoe/597-config-git-version-in…

    …fo-rab
    
    Should be final commits for Git version parent info PR #598 (#597)
    bartlettroscoe authored Jan 25, 2024
    Configuration menu
    Copy the full SHA
    da80610 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    2f17d8e View commit details
    Browse the repository at this point in the history