Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-73050

Env variables GIT_AUTHOR_DATE and GIT_COMMITTER_DATE being ignored

    • Icon: New Feature New Feature
    • Resolution: Won't Do
    • Icon: Major Major
    • git-plugin
    • None

      Hello,

      We have an issue internally that requires us to set the hash revision of a merge commit.

      We found out that if we set the env variables GIT_AUTHOR_DATE and GIT_COMMITTER_DATE it will be possible. When we do this locally, it works. But when we try to do the same on Jenkins in a Pull Request build it doesn't work.

      I've added the Jenkinsfile as attachment.
      So it seems that the git plugin is ignoring the env variables when doing the automatic commit for the PR build. We also made sure that the env variables are set by priting them Can this be improved by letting the plugin read those two variables?

      Thank you. If you need more information please let me know.

          [JENKINS-73050] Env variables GIT_AUTHOR_DATE and GIT_COMMITTER_DATE being ignored

          Mark Waite added a comment -

          Thanks for your input.

          I don't plan to change the behavior of the merge commit that is performed by the git plugin when it is configured to merge a branch. I think that level of control is best left to the user. You can choose to perform the merge yourself in your Pipeline and use the --date argument to command line git or you can set the environment variable.

          Mark Waite added a comment - Thanks for your input. I don't plan to change the behavior of the merge commit that is performed by the git plugin when it is configured to merge a branch. I think that level of control is best left to the user. You can choose to perform the merge yourself in your Pipeline and use the --date argument to command line git or you can set the environment variable.

            Unassigned Unassigned
            marcodomingues99 Marco
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: