[JIRA] (JENKINS-59206) Environment variables tag name and branch name set incorrectly

2019-09-04 Thread mark.earl.wa...@gmail.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Mark Waite updated  JENKINS-59206  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
 Jenkins /  JENKINS-59206  
 
 
  Environment variables tag name and branch name set incorrectly   
 

  
 
 
 
 

 
Change By: 
 Mark Waite  
 
 
Status: 
 Open Fixed but Unreleased  
 
 
Resolution: 
 Not A Defect  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-issues/JIRA.201655.1567527731000.6728.1567615320926%40Atlassian.JIRA.


[JIRA] (JENKINS-59206) Environment variables tag name and branch name set incorrectly

2019-09-04 Thread mark.earl.wa...@gmail.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Mark Waite updated  JENKINS-59206  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
 Jenkins /  JENKINS-59206  
 
 
  Environment variables tag name and branch name set incorrectly   
 

  
 
 
 
 

 
Change By: 
 Mark Waite  
 
 
Status: 
 Fixed but Unreleased Closed  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-issues/JIRA.201655.1567527731000.6732.1567615320983%40Atlassian.JIRA.


[JIRA] (JENKINS-59206) Environment variables tag name and branch name set incorrectly

2019-09-04 Thread michaelper...@gmail.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 MICHAEL PERZEL commented on  JENKINS-59206  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Environment variables tag name and branch name set incorrectly   
 

  
 
 
 
 

 
 Thanks, that's exactly what i need.   I do think it's unclear why git_branch is set to the the tag name but I no longer have a need for this environment variable.  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-issues/JIRA.201655.1567527731000.6726.1567615200108%40Atlassian.JIRA.


[JIRA] (JENKINS-59206) Environment variables tag name and branch name set incorrectly

2019-09-03 Thread mark.earl.wa...@gmail.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Mark Waite commented on  JENKINS-59206  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Environment variables tag name and branch name set incorrectly   
 

  
 
 
 
 

 
 In declarative Pipeline, there is the condition (see Pipeline syntax) when buildingTag A stage with that directive will only be built when a tag is being built. I suspect something similar could be done with scripted Pipeline, checking for the existence or non-existence of the environment variable TAG_NAME. I don't know of a way to do anything like that in Freestyle, Maven, or Matrix job types.  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-issues/JIRA.201655.1567527731000.6015.1567538340111%40Atlassian.JIRA.


[JIRA] (JENKINS-59206) Environment variables tag name and branch name set incorrectly

2019-09-03 Thread mark.earl.wa...@gmail.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Mark Waite edited a comment on  JENKINS-59206  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Environment variables tag name and branch name set incorrectly   
 

  
 
 
 
 

 
 I disagree.  A tag does not reliably have an association to a branch.  A tag is a "a pointer to a specific commit".  It identifies a specific commit by providing a simplified name to describe that commit.A branch is a " lightweight movable pointer".Depending on the state of the repository, a tag may be on no branch, one branch, or many branches.  Attempting to assign a branch name which is not the name of the tag is hard or impossible to do reliably.Output from {{git log --graph --pretty=oneline --abbrev-commit --decorate}}:{noformat}* dd46d51 (HEAD -> master) More information added* f6db255 Add another date* dacdad4 (tag: v2.0) Another new change* c4825db Add comment about v1.1| * ec23f88 (branch-1.x) Another README change| * 8c5c32a New change on branch-1.x| | * a6a83ee (tag: orphan-v1.1) Orphan change, no branch| |/| * 1df4892 A newer change on branch-1.x| * 3990059 (tag: v1.0) A change on branch-1.x|/* a693bf7 Add comment about tag* 183db1f Add README{noformat}In that case, the tag {{orphan-1.1}} is not directly associated with any branch, while the tag {{v1.0}} might be associated with {{branch-1.x}}.  However, if branch-1.x is merged into master, then the tag {{v1.0}} might be associated with both {{branch-1.x}} and {{master}}.After merging branch-1.x into master:{noformat}*   7a7ce4d (HEAD -> master) Merge branch 'branch-1.x'|\| * ec23f88 (branch-1.x) Another README change| * 8c5c32a New change on branch-1.x* | dd46d51 More information added* | f6db255 Add another date* | dacdad4 (tag: v2.0) Another new change* | c4825db Add comment about v1.1| | * a6a83ee (tag: orphan-v1.1) Orphan change, no branch| |/| * 1df4892 A newer change on branch-1.x| * 3990059 (tag: v1.0) A change on branch-1.x|/* a693bf7 Add comment about tag* 183db1f Add README{noformat} In this case, after merging, the tag {{v1.0}} is now on both branch-1.x and on master.  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)  
 

  

[JIRA] (JENKINS-59206) Environment variables tag name and branch name set incorrectly

2019-09-03 Thread michaelper...@gmail.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 MICHAEL PERZEL commented on  JENKINS-59206  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Environment variables tag name and branch name set incorrectly   
 

  
 
 
 
 

 
 Okay, I agree with your explanation. With that in mind should git_branch and branch_name be set to the tag name when the build was triggered by a tag commit?   I'm trying to accomplish being able to differentiate between builds triggered from a commit to a branch and from tagging a commit.  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-issues/JIRA.201655.1567527731000.6009.1567537800105%40Atlassian.JIRA.


[JIRA] (JENKINS-59206) Environment variables tag name and branch name set incorrectly

2019-09-03 Thread mark.earl.wa...@gmail.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Mark Waite edited a comment on  JENKINS-59206  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Environment variables tag name and branch name set incorrectly   
 

  
 
 
 
 

 
 I disagree.  A tag does not reliably have an association to a branch.  A tag is a "a pointer to a specific commit".  It identifies a specific commit by providing a simplified name to describe that commit.A branch is a " lightweight movable pointer".Depending on the state of the repository, a tag may be on no branch, one branch, or many branches.  Attempting to assign a branch name which is not the name of the tag is hard or impossible to do reliably.Output from {{git log --graph --pretty=oneline --abbrev-commit --decorate}}:{noformat}* dd46d51 (HEAD -> master) More information added* f6db255 Add another date* dacdad4 (tag: v2.0) Another new change* c4825db Add comment about v1.1| * ec23f88 (branch-1.x) Another README change| * 8c5c32a New change on branch-1.x| | * a6a83ee (tag: orphan-v1.1) Orphan change, no branch| |/| * 1df4892 A newer change on branch-1.x| * 3990059 (tag: v1.0) A change on branch-1.x|/* a693bf7 Add comment about tag* 183db1f Add README{noformat}In that case, the tag {{orphan-1.1}} is not directly associated with any branch, while the tag {{v1.0}} might be associated with {{branch-1.x}}.  However, if branch-1.x is merged into master, then the tag {{v1.0}} might be associated with both {{branch-1.x}} and {{master}}. After merging branch-1.x into master:{noformat}*   7a7ce4d (HEAD -> master) Merge branch 'branch-1.x'|\| * ec23f88 (branch-1.x) Another README change| * 8c5c32a New change on branch-1.x* | dd46d51 More information added* | f6db255 Add another date* | dacdad4 (tag: v2.0) Another new change* | c4825db Add comment about v1.1| | * a6a83ee (tag: orphan-v1.1) Orphan change, no branch| |/| * 1df4892 A newer change on branch-1.x| * 3990059 (tag: v1.0) A change on branch-1.x|/* a693bf7 Add comment about tag* 183db1f Add README{noformat}  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)  
 

  
 

   





-- 
You received this message because 

[JIRA] (JENKINS-59206) Environment variables tag name and branch name set incorrectly

2019-09-03 Thread mark.earl.wa...@gmail.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Mark Waite edited a comment on  JENKINS-59206  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Environment variables tag name and branch name set incorrectly   
 

  
 
 
 
 

 
 I disagree.  A tag does not reliably have an association to a branch.  A tag is a "a pointer to a specific commit".  It identifies a specific commit by providing a simplified name to describe that commit.A branch is a " lightweight movable pointer".Depending on the state of the repository, a tag may be on no branch, one branch, or many branches.  Attempting to assign a branch name which is not the name of the tag is hard or impossible to do reliably.Output from {{git log --graph --pretty=oneline --abbrev-commit --decorate}}:{noformat}* dd46d51 (HEAD -> master) More information added* f6db255 Add another date* dacdad4 (tag: v2.0) Another new change* c4825db Add comment about v1.1| * ec23f88 (branch-1.x) Another README change| * 8c5c32a New change on branch-1.x| | * a6a83ee (tag: orphan-v1.1) Orphan change, no branch| |/| * 1df4892 A newer change on branch-1.x| * 3990059 (tag: v1.0) A change on branch-1.x|/* a693bf7 Add comment about tag* 183db1f Add README{noformat}In that case, the tag {{orphan-1.1}} is not directly associated with any branch, while the tag {{v1.0}} might be associated with {{branch- 1x 1.x }}.  However, if branch-1.x is merged into master, then the tag {{v1.0}} might be associated with both {{branch-1.x}} and {{master}}.  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-issues/JIRA.201655.1567527731000.5982.1567532940109%40Atlassian.JIRA.


[JIRA] (JENKINS-59206) Environment variables tag name and branch name set incorrectly

2019-09-03 Thread mark.earl.wa...@gmail.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Mark Waite commented on  JENKINS-59206  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Environment variables tag name and branch name set incorrectly   
 

  
 
 
 
 

 
 I disagree. A tag does not reliably have an association to a branch.  A tag is a "a pointer to a specific commit". It identifies a specific commit by providing a simplified name to describe that commit. A branch is a " lightweight movable pointer". Depending on the state of the repository, a tag may be on no branch, one branch, or many branches. Attempting to assign a branch name which is not the name of the tag is hard or impossible to do reliably. Output from the command git log --graph --pretty=oneline --abbrev-commit --decorate: 

 
* dd46d51 (HEAD -> master) More information added
* f6db255 Add another date
* dacdad4 (tag: v2.0) Another new change
* c4825db Add comment about v1.1
| * ec23f88 (branch-1.x) Another README change
| * 8c5c32a New change on branch-1.x
| | * a6a83ee (tag: orphan-v1.1) Orphan change, no branch
| |/
| * 1df4892 A newer change on branch-1.x
| * 3990059 (tag: v1.0) A change on branch-1.x
|/
* a693bf7 Add comment about tag
* 183db1f Add README
 

 In that case, the tag orphan-1.1 is not directly associated with any branch, while the tag v1.0 might be associated with branch-1x. However, if branch-1.x is merged into master, then the tag v1.0 might be associated with both branch-1.x and master.  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
To view this discussion on the web visit 

[JIRA] (JENKINS-59206) Environment variables tag name and branch name set incorrectly

2019-09-03 Thread mark.earl.wa...@gmail.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Mark Waite edited a comment on  JENKINS-59206  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Environment variables tag name and branch name set incorrectly   
 

  
 
 
 
 

 
 I disagree.  A tag does not reliably have an association to a branch.  A tag is a "a pointer to a specific commit".  It identifies a specific commit by providing a simplified name to describe that commit.A branch is a " lightweight movable pointer".Depending on the state of the repository, a tag may be on no branch, one branch, or many branches.  Attempting to assign a branch name which is not the name of the tag is hard or impossible to do reliably.Output from  the command  {{git log --graph --pretty=oneline --abbrev-commit --decorate}}:{noformat}* dd46d51 (HEAD -> master) More information added* f6db255 Add another date* dacdad4 (tag: v2.0) Another new change* c4825db Add comment about v1.1| * ec23f88 (branch-1.x) Another README change| * 8c5c32a New change on branch-1.x| | * a6a83ee (tag: orphan-v1.1) Orphan change, no branch| |/| * 1df4892 A newer change on branch-1.x| * 3990059 (tag: v1.0) A change on branch-1.x|/* a693bf7 Add comment about tag* 183db1f Add README{noformat}In that case, the tag {{orphan-1.1}} is not directly associated with any branch, while the tag {{v1.0}} might be associated with {{branch-1x}}.  However, if branch-1.x is merged into master, then the tag {{v1.0}} might be associated with both {{branch-1.x}} and {{master}}.  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-issues/JIRA.201655.1567527731000.5980.1567532880309%40Atlassian.JIRA.


[JIRA] (JENKINS-59206) Environment variables tag name and branch name set incorrectly

2019-09-03 Thread michaelper...@gmail.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 MICHAEL PERZEL created an issue  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
 Jenkins /  JENKINS-59206  
 
 
  Environment variables tag name and branch name set incorrectly   
 

  
 
 
 
 

 
Issue Type: 
  Improvement  
 
 
Assignee: 
 Mark Waite  
 
 
Components: 
 git-plugin  
 
 
Created: 
 2019-09-03 16:22  
 
 
Environment: 
 Jenkins jenkins-2.187-1.1  Git-plugin 4.0.0-rc  
 
 
Priority: 
  Minor  
 
 
Reporter: 
 MICHAEL PERZEL  
 

  
 
 
 
 

 
 In a multi-branch pipeline, if you commit to the master branch and print out the values of the environments variables you will see: BRANCH_NAME = master GIT_BRANCH = master If you trigger a build via committing a tag to the same repository and print out the variables (where the tag name is 4.1.0): BRANCH_NAME = 4.1.0 GIT_BRANCH = 4.1.0 TAG_NAME = 4.1.0 I believe the correct values for the tagged build should be: BRANCH_NAME = master GIT_BRANCH = master TAG_NAME = 4.1.0  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment