Giter Site home page Giter Site logo

git-patch's People

Contributors

pvam avatar shridharama avatar shubhamtagra avatar vrajat avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

git-patch's Issues

Command to edit a patch

A common requirement is to edit a patch because of a conflict or other errors. The command line should be:
git patch begin-edit --id --branch # To start edit
git patch complete-edit

The script should implement the following workflow:

  • Create or checkout dev-branch
  • Apply all patches up to patch-id
  • Developer makes required changes and commits the changes.
  • Developer calls complete-edit
  • complete-edit will regenerate and replace the patch.

begin-edit and complete-edit will store any metadata in .patch/cmd_state.yml. Logs will be stored in .patch/edit-<timestamp>.log

Provide a command to create a development branch

For e.g.

git patch create-branch --help
usage: git-patch create-branch [-h] [-n NAME] [-r REMOTE]

optional arguments:
  -h, --help            show this help message and exit
  -n NAME, --name NAME  Name of branch
  -r REMOTE, --remote REMOTE
                        Name of Git Remote

Support combining two patches

Patches can be combined esp. if they belong to the same feature or module. A subsequent patch maybe a bug fix which doesnt have to be maintained separately.

Have support for checkpointing the upstream master

Currently we begin the patching by downloading latest commit from master. Then we manually resolve conflicts in an iterative fashion. In each iteration we expect to resume from the patch we manually fixed last time. This desired behaviour degrades when master has an update at the later point of time and is in conflict with one of the earlier patches. This can repeatedly break in-progress patch work making user go back and forth.

Hack:
To make this more productive, we can have a pre-processing step wherein you cut the upstream master branch at a certain commit and have that serve as a master for the next steps. With this change, we will only move forward while fixing patches and things remain more clear. The downside of-course is that we miss the commits introduced after the cut.

Support classifying commits into sections

Patches can be naturally clubbed together. For e.g. the first patch contains a feature and there are subsequent bugs or feature enhancements. If these commits are classified into sections, then they can be managed together esp. w.r.t skipping or to compact them into a single commit. Provide a couple of functions to manage patches and sections:

  • create-section
  • move-patch

Redesign patch edit workflow to fix conflicts

The workflow to fix conflicts is cumbersome. Conflicts are identified by running git patch apply. Then the branch has to be recreated and patches applied. Instead allow developers to edit conflicts when apply command detects conflicts.

patch apply fails with an except AttributeError: 'NoneType' object has no attribute 'rfind'

Traceback (most recent call last):
File "/Users/rajatv/qubole_src/presto_env/bin/git-patch", line 11, in
sys.exit(main())
File "/Users/rajatv/qubole_src/presto_env/lib/python2.6/site-packages/git_patch/git_patch.py", line 290, in main
argument.func(argument, patches)
File "/Users/rajatv/qubole_src/presto_env/lib/python2.6/site-packages/git_patch/git_patch.py", line 135, in patch_apply
section_apply(args, patches)
File "/Users/rajatv/qubole_src/presto_env/lib/python2.6/site-packages/git_patch/git_patch.py", line 167, in section_apply
if commit == os.path.basename(args.patch):
File "/Users/rajatv/qubole_src/presto_env/lib/python2.6/posixpath.py", line 111, in basename
i = p.rfind('/') + 1

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.