logo
down
shadow

Git status upstream and downstream


Git status upstream and downstream

By : pdgendt
Date : November 22 2020, 10:54 AM
I hope this helps . There is no such thing built in, and tracking is stored only in the other direction: "X tracks Y", not "Y is tracked by ...", which is more complex as the "..." part can expand to more than one item. (Also, I believe it's much more typical for Y to be a remote-tracking branch in the first place, in which case you can't ever be on Y—though a command that tries to find "what tracks Y" could certainly take arguments, so you could say "tell me about any of my branches that track origin/master).
That said, it's certainly possible to build such a thing. The algorithm looks like this, in Python-esque pseudo-code:
code :
table = {}
for branch in local_branches:
    try:
        remote, tracked = get_what_branch_tracks(branch)
    except ValueError:
        continue # local branch "branch" not tracking anything
    try:
        br2 = analyze(branch, remote, tracked)
    except ValueError:
        warn('upstream for %s is gone' % branch)
        continue
    # at this point br2 is, e.g., origin/master or a local branch that "branch" tracks
    table.setdefault(br2, []).append(branch)

# now table[] is a table of branches that are tracked, with
# each table[key] being the branches that track branch "key"
# to compute "git status" for branch X that tracks Y:
nahead=$(git rev-list --count Y..X) # we're ahead $nahead commits
nbehind=$(git rev-list --count X..Y) # and behind $nbehind


Share : facebook icon twitter icon
Jenkins/Hudson upstream job does not get the status "ball" color of the downstream jobs

Jenkins/Hudson upstream job does not get the status "ball" color of the downstream jobs


By : user3117234
Date : March 29 2020, 07:55 AM
hope this fix your issue I found the solution. There is a plugin called Groovy Postbuild pluging that let you execute a Groovy script in the post build phase. Addind a simple code to the downstream jobs you can modify the upstream overall status.
This is the code you need to add:
code :
upstreamBuilds = manager.build.getUpstreamBuilds();

upstreamJob = upstreamBuilds.keySet().iterator().next();

lastUpstreamBuild = upstreamJob.getLastBuild();

if(lastUpstreamBuild.getResult().isBetterThan(manager.build.result)) {
    lastUpstreamBuild.setResult(manager.build.result);
}
how to trigger jenkins downstream job irrespective upstream job status

how to trigger jenkins downstream job irrespective upstream job status


By : nab278
Date : March 29 2020, 07:55 AM
Any of those help Edit: I think the solution is to not have your upstream job failed in the first place, you can still handle failed downstream jobs with the help of i.e. env. variables or other means.
Access upstream job parameters in downstream job

Access upstream job parameters in downstream job


By : psj2013
Date : March 29 2020, 07:55 AM
This might help you Just parametrize the downstream job and pass the parameters on the call.
code :
build job: 'your-downstream-job', parameters: [[$class: 'StringParameterValue', name: 'YOUR_STRING_PARAM', value: "${yourRandomGeneratedStringVariable}" ]]
Upstream and Downstream definition

Upstream and Downstream definition


By : Anant Shah
Date : March 29 2020, 07:55 AM
wish helps you I know this is old but I think the other answer has it the wrong way around. Think of it this way - if you are upstream from something what you do can affect it and equally something upstream from you affects you but something downstream can't.
So to use the same method, given a system S:
Aggregate multiple upstream SCM changes in downstream job

Aggregate multiple upstream SCM changes in downstream job


By : Isha Gupta
Date : March 29 2020, 07:55 AM
I wish this helpful for you Jenkins naturally shows changes on a job.
A downstream job is linked only in a workflow sense. Do Job B after Job A. Linking two jobs in this way does not extend to showing changes.
Related Posts Related Posts :
  • How to show total number of lines changed in git log one-line format?
  • Why is git cherry so astonishingly slow?
  • Git Remote Push Fatal Error
  • Temporarily lock a git repository
  • How to keep a deployment repo for Heroku within a development Git repo and keep them separate?
  • Why double-dot vs triple-dot in git behaves different for diff and log
  • How to retroactively add commits to a Git repository?
  • How can I import a 72GB dump file into git?
  • git + lighttpd: how to defined permissions for users and groups?
  • How do I give all GitLab users access to all repositories without making the repos public?
  • Unable to push file to git repository
  • Remove intermediate commit in Visual Studio Online
  • Why is Git committing the old version of a file?
  • git pull - will it fetch tags on remote by default?
  • Can I change my .gitignore at a remote site and will it push to GITHUB repro when I do a git push?
  • Docker git clone on container launch?
  • How to get only YYYY-MM-DD output from git-log?
  • Git keeps resetting my files after a hard reset?
  • When you clone a repo like Laravel into an existing project do you pull it in as submodule even if you're not planning t
  • Git Source Control between two networks
  • Best practice for multiple vagrant boxes
  • What's the command to reset a file to a specific commit?
  • Git: do not create index.lock for read-only operations
  • Find the right parent of a merge commit in a non-interactive way
  • git push non for all the commits
  • bitbucket git commits missing
  • Git: Duplicates of files are created
  • Bash script globing error when doing a curl for custom Github CLI API with oAuth token header
  • troubling rebasing branch with merge conflics
  • Stash/branch/working copy confusion
  • How can I ignore all folders whose names are of the form <pattern>*?
  • Git syncing part of a branch with other branches
  • How to make code suggestion in github/bitbucket?
  • Change mail address in each commit
  • Inspecting branches with command line Git
  • Git distributed revision control and filetypes
  • Changing source control type in TFS 2013
  • How to use a new remote git repository when there is no access to old git repository?
  • shadow
    Privacy Policy - Terms - Contact Us © ourworld-yourmove.org