Code Monkey home page Code Monkey logo

Comments (5)

acabal avatar acabal commented on June 17, 2024

Well, git merge may introduce merge conflicts. That's generally why the two operations are separate. git pull is (basically) a kind of alias for git fetch directly followed by git merge.

With only git fetch, we can inspect the differences between the repos before attempting a merge. Though, I assume you would want to merge upstream changes anyway, if you're syncing the repos. The only question is what do we do in the case of a merge conflict. The script would have to alert the user that a merge conflict exists in xyz repos after syncing.

Also, we want to avoid merge commits. I don't know what the formula is for git fetch + git merge, but git pull --rebase rebases the repo on top of upstream changes, instead of creating merge commits. That's what we want to accomplish, regardless of what we do.

from web.

vr8hub avatar vr8hub commented on June 17, 2024

Right. I guess the question is what do we want the script to do. IOW, if someone is using the script to sync everything, isn't it because they want everything synced? Why would there be merge conflicts? If they're actively working on one of the ~400 repositories, then maybe they wouldn't be using the script to sync everything until they were done? (I'm asking; I'm not doing any with these but having them there for testing; frankly, if I did make changes, I want them to go away if I resync. But I don't know how anyone else uses a full synced WD copy.)

Alternatively, if that is commonly done (making changes to the bulk-synced versions of the repositories while still wanting to sync everything and keep the changes), maybe we have the script check for the presence of a (empty) file, either in the repository or at the top level of the sync directory, that tells the script to skip doing a merge (or a fetch?)

Bottom line, it's easy enough for me to just run a git merge on every directory every time I sync. I'm just trying to figure out if we can make things easier on everyone else (and me) by making a change to the script that will do the right thing and not do the wrong thing. Maybe a --pull flag that says use git pull --rebase instead of git fetch? The default would do what it does now, fetch only, using the flag would do a pull --rebase instead.

from web.

acabal avatar acabal commented on June 17, 2024

Merge conflicts can happen (they have to me) and it's an important error case we have to consider. I think it would be helpful if the script was updated to do a git pull --rebase automatically; but, it should silence git's pull output unless either --verbose is invoked, or there is a merge conflict, in which case the script should alert the user.

from web.

vr8hub avatar vr8hub commented on June 17, 2024

All right, I'll need to create some merge conflicts (with my repositories, not SE's :)) and see how best to handle them. I'll work on it.

from web.

acabal avatar acabal commented on June 17, 2024

Closed due to inactivity

from web.

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.