Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolves "gitdist: Add Default Development Branch Support #236

Conversation

jmgate
Copy link
Collaborator

@jmgate jmgate commented Oct 26, 2017

Here's an initial implementation that allows a user to pass _DEFAULT_BRANCH_ to any command that would normally take a reference (branch, tag, SHA1). Users can set up their .gitdist file as follows:

. master
someRepo develop
anotherRepo app-dev
# etc

The lines of the file are read and then split on spaces. The first entry is the path to the repo gitdist will be working with. If there is a second entry, that will be substituted any time _DEFAULT_BRANCH_ is used on the command line. If no second entry exists, the master branch is assumed.

This allows for the following workflow:

gitdist checkout _DEFAULT_BRANCH_
gitdist checkout -b <featureBranch>
# do some work
gitdist fetch
gitdist rebase origin/_DEFAULT_BRANCH_
# etc.

There may be a better way to implement this, but this at least gets us started.

Closes #235

@jmgate jmgate force-pushed the 235-gitdistAddDefaultDevelopmentBranchSupport branch 3 times, most recently from 0862ea8 to b217637 Compare November 1, 2017 23:05
@jmgate jmgate force-pushed the 235-gitdistAddDefaultDevelopmentBranchSupport branch from b217637 to 432f3aa Compare November 2, 2017 19:21
Here's an initial implementation that allows a user to add default
development branches to the .gitdist file in the form

. master
otherRepo develop
thirdRepo master

If those default development branches aren't specified, master is
assumed.  The user can then pass _DEFAULT_BRANCH_ to any command that
accepts a reference and gitdist should replace _DEFAULT_BRANCH_ with the
appropriate branch from the .gitdist file.  The documentation for this
feature can be accessed with --dist-help=default-branch.
@jmgate jmgate force-pushed the 235-gitdistAddDefaultDevelopmentBranchSupport branch from 432f3aa to b7fdc87 Compare November 2, 2017 20:51
@jmgate
Copy link
Collaborator Author

jmgate commented Nov 2, 2017

@bartlettroscoe, I'm pretty sure the work on this PR is finished now.

@bartlettroscoe
Copy link
Member

@jmgate, okay, I will take a look. Thanks!

I also moved 'default-branch' before 'usage-tips' because I think that is a
more natural order, expecially for --dist-help=all.
@bartlettroscoe
Copy link
Member

@jmgate,

The changes to gitdist.py look great; very clean. The unit tests look excellent. I did not even bother trying to manually test this myself. I have little doubt that this is working correctly from just looking at the unit tests. I think this is a nice feature to add to the script.

I added some commits to make some small tweaks to the documentation and add --dist-help=default-branch output to the TriBITS developers guide. If these changes look okay to you, then I can go ahead and merge and push this branch.

Thanks for doing all of this!

@jmgate
Copy link
Collaborator Author

jmgate commented Nov 3, 2017

Yup, that all looks fine to me. Thanks @bartlettroscoe.

@bartlettroscoe bartlettroscoe merged commit bb5715b into TriBITSPub:master Nov 6, 2017
@jmgate jmgate deleted the 235-gitdistAddDefaultDevelopmentBranchSupport branch November 6, 2017 14:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants