GithubHelp home page GithubHelp logo

Comments (7)

sebastianfeldmann avatar sebastianfeldmann commented on June 10, 2024

Adding something like {$CHANGED_FILES} sounds like a great idea.

Not sure everything is already there but BlockFixupAndSquashCommits should be a good place to start.

I just looked at the current Placeholder implementations. Currently they don't have access to IO but they would need that in order to get the refs that will be pushed. You can not just assume that it will be master.
Maybe you want to push to some feature branch or multiple branches at the same time.
But as I mentioned BlockFixupAndSquashCommits is a good stating point to understand how to gather the necessary information.

I'm not getting the |base:<referecnce> idea, what would that modifier do?

But yes, definitely open for something like this.

from captainhook.

CircleCode avatar CircleCode commented on June 10, 2024

I'm not getting the |base:<referecnce> idea, what would that modifier do?

As I said, the notion of changed files can be a bit ambiguous. Changed against what?.
In my mind, it means “The files you explicitely chnaged on your branch since you forked from the branch this will be merged into an the end”, or said differently in my workflow: “the files you changed sinced you forked from origin/master”. However, as you said, some will want another reference branch, like “origin/prod”, or even the remote reference being pushed to.

The {$CHANGED_FILES}|base:<referecnce> would allow such customizations:

  • in my own need, it would be {$CHANGED_FILES|base:origin/master}
  • it could also be {$CHANGED_FILES|base:custom_remote/prod}
  • and if empty, this could fallback on the remote reference being pushed to (However, I'm not sure this is possible in every case since this reference may not exist yet, and I'm not sure what I would like {$CHANGED_FILES} to return in this case

from captainhook.

sebastianfeldmann avatar sebastianfeldmann commented on June 10, 2024

You can not just define what you want your base to be.
If you are pushing to different branches this will fail.

You have to determine on push what the current local and remote states are.

Luckily git provides that information as stdIn to the pre-push hook.
You can check BlockFixupAndSquashCommits for more details.

The most important thing is that you can push multiple branches at the same time.
So you receive potentially multiple LOCAL_STATE<-->REMOTE_STATE combinations.

from captainhook.

sebastianfeldmann avatar sebastianfeldmann commented on June 10, 2024

I started working on this, hopefully I have something to test tonight

from captainhook.

CircleCode avatar CircleCode commented on June 10, 2024

In the case several references are pushed, with different changed files, what will be the value of this variable?

from captainhook.

sebastianfeldmann avatar sebastianfeldmann commented on June 10, 2024

I my opinion it should contain all files, so if you push file A and B to branch X and file C and D to branch Y the list should contain A, B, C, D

from captainhook.

sebastianfeldmann avatar sebastianfeldmann commented on June 10, 2024

Fixed with 5.15.4

from captainhook.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.