Git Product home page Git Product logo

Comments (4)

SebastianBalle avatar SebastianBalle commented on June 16, 2024 1

I see what you mean. I think for now it would be valuable to have the --fail-if-unpushed could solve the problem if this could be specified together with the --fail-if-dirty then we can have the alias alias git='f(){ if ! gitman list --fail-if-dirty --fail-if-unpushed > /dev/null; then gitman list --fail-if-dirty --fail-if-unpushed; fi; git "$@"; unset -f f; }; f' as well as have the gitman list --fail-if-dirty --fail-if-unpushed in a pre-commit hook.

I guess it is not possible for git to be aware of changes made introduced by another tool (gitman) so until then the above alias will solve it.

from gitman.

jacebrowning avatar jacebrowning commented on June 16, 2024

To be clear, are you proposing that --fail-if-dirty should cause gitman to return an error if there are any unpushed changes?

Generally, "dirty" does not refer to unpushed changes so perhaps a new --fail-if-unpushed option is in order?

from gitman.

SebastianBalle avatar SebastianBalle commented on June 16, 2024

Yes, I would like gitman to return an error (exit code 1) if changes are found in any dependency repositories. This could be used by other scripts.

At least in our use of git submodules, we work directly in the submodule to test the changes in the context of where they are used. If they are sourced directly with no changes, I guess the functionality of gitman would cover this. When/if we make any changes to a submodule, git will indicate modified: ../../[path-to-submodule] (modified content), which will allow the developer to commit and push the change to the submodule. In an ideal world, git would also recognize changes in gitman dependency repositories.

I would actually prefer to minimize the number of flags, as a single flag could cover both --fail-if-dirty and --fail-if-unpushed (unless there is a specific reason for separating the flags). However, the problem still exists if git does not recognize these changes locally, so we would need to have a custom alias for git (as in previous comment) to ensure we execute the correct gitman command to verify these local changes to any dependency repositories.

Alternatively, we could include gitman list in a pre-commit hook to avoid missing any local changes to the dependency repository. The exit code would be valuable here as well.

from gitman.

jacebrowning avatar jacebrowning commented on June 16, 2024

My initial thought on why --fail-if-dirty should not care about remote repositories is that it currently operates using the same mechanism install uses to check for changes that will be overwritten. That is to say, if gitman list --fail-if-dirty fails, then gitman install will necessary fail unless the --force option is added.

from gitman.

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.