Coder Social home page Coder Social logo

clean-push's Issues

a few quick examples

Hi, this looks promising. It would be nice to have a few quick examples of how to use it. I presume I clone this repo and maybe copy the two files clean-push and 4-way-diff into my repo? Then call them via sh clean-push on the command line. I can, and will figure it out, but it would be nice if you just spoon fed it to me :)
Thanks.

assumes origin

hi,
nice script, but it seems to assume remotes are at 'origin'. in my case I'm commonly using 'upstream' for example. it would be great if I could pass that alternative in somewhere.
A few actual usage examples in the readme would also be v helpful instead of needing to read the script to see what the options are.

Cheers.

no-diff (nothing added to the commit) flow can be improved

Example session where someone else merged a delta into main and my local dev already had that delta.
In this case we detect this a bit late (while on the temp-branch doing the integration) and when we fail we remain there.

% ./clean-push  
./clean-push: cool: repo is clean (fully committed)
Main branch:      main
Feature branch:   dev
Temporary branch: temp-branch
-----------------------------------------------------------------
(1) Pull latest remote 'main' into local branches (main & dev)
    (conflicts may be detected)
$ pull-main-branch-into main && pull-main-branch-into dev
Switched to branch 'main'
Your branch is up to date with 'origin/main'.
remote: Enumerating objects: 9, done.
remote: Counting objects: 100% (9/9), done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 5 (delta 2), reused 3 (delta 2), pack-reused 0
Unpacking objects: 100% (5/5), done.
From ssh://github.com/arielf/clean-push
 * branch            main       -> FETCH_HEAD
   0328273..9e3e8cc  main       -> origin/main
Updating 0328273..9e3e8cc
Fast-forward
 4-way-diff | 3 +++
 clean-push | 9 +++++++--
 2 files changed, 10 insertions(+), 2 deletions(-)
Switched to branch 'dev'
Your branch is up to date with 'origin/dev'.
From ssh://github.com/arielf/clean-push
 * branch            main       -> FETCH_HEAD
Updating fc6ab3f..9e3e8cc
Fast-forward
-----------------------------------------------------------------
(2) Create temporary work branch from 'main' -> 'temp-branch'
$ git checkout -b temp-branch main
Switched to a new branch 'temp-branch'
-----------------------------------------------------------------
(3) Merge + Squash delta from 'dev' (on pristine temp-branch branch)
    (conflicts may be detected)
$ git merge --squash dev
 (nothing to squash)Already up to date.
-----------------------------------------------------------------
(4) Commit on 'temp-branch': please edit/clean the commit message in your editor

    Note: the final form of this commit message is _exactly_ how it
    will appear in the pushed PR. First line will be subject/heading.
$ git commit

On branch temp-branch
Untracked files:
        tryme

nothing added to commit but untracked files present
./clean-push: git commit FAILED: status=1

If we could detect the empty diff case at step (3) "Already up to date" which is not an error, we could recover more elegantly:

  • Go back to dev branch
  • Delete temp-branch
  • Give a better message (not error, just say that there's nothing to do)

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.