lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Solr Wiki] Update of "Git commit process" by CassandraTargett
Date Wed, 10 May 2017 20:51:08 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Solr Wiki" for change notification.

The "Git commit process" page has been changed by CassandraTargett:
https://wiki.apache.org/solr/Git%20commit%20process?action=diff&rev1=5&rev2=6

Comment:
add info for merging branch with master

  = Committing changes to Git =
  
  <!> '''Totally incomplete, but we have to start somewhere. Please contribute!''' <!>
- 
- <!> UNDER CONSTRUCTION, INSTRUCTIONS ARE NOT COMPLETE OR EVEN GUARANTEED TO WORK <!>
- 
  
  '''Disclaimer''' Currently, we're still working out the preferred way of committing to Git,
so this page is definitely a "work in progress". If you're a seasoned Git pro do not feel
that what's written here is a ''requirement'', but do please look it over and see if it's
reasonably compatible.
  
@@ -55, +52 @@

   * {{{git diff --stat origin/master..}}} will show you committed (locally) but not pushed
changes
   * If you omit the {{{-m}}} flag you'll find yourself in a vi-like editor where you can
enter long commit messages.
  
- === method 2 ===
- 
- <!> Anyone want to volunteer to add something here? <!>
- 
  === Backporting changes from trunk to 5x (6x sometime soon) ===
  The usual recommendation is to "cherry pick".
   * git checkout branch-5x
@@ -75, +68 @@

  
  == More sophisticated options for more sophisticated people ==
  
- <!> Hey, Git Pros! Feel free to add information here. <!>
- 
   * [[https://github.com/dweiss/lucene-git-guides/blob/master/04-working-directly-on-a-remote-tracking-branch.sh|Dawid's
Git Page]] Lots of options here, a fine way to get more sophisticated in your use of Git.
  
  == Working with Branches ==
@@ -91, +82 @@

  
  While working on your branch, you should periodically bring it up to date with "master".
This will make eventual merging with master later simpler, because you resolve any conflicts
as you go. To do this:
  
-  * {{{git co master}}} - first checkout master to be sure you have all the latest changes.
If you are already on master, {{{git pull}}} to make sure you have the latest.
+  * {{{git checkout master}}} - first checkout master to be sure you have all the latest
changes. If you are already on master, {{{git pull}}} to make sure you have the latest.
-  * {{{git co <branch>}}} - next checkout your branch.
+  * {{{git checkout <branch>}}} - next checkout your branch.
   * {{{git merge master}}} - this will apply all the changes in master that are not local
to your branch.
  
  At this point, you likely have conflicts. You need to resolve those, and there are a number
of ways to do that.
@@ -104, +95 @@

  
  Git may prompt you to {{{git rebase --continue}}}, if conflicts are resolved, that should
end up in the same place, of prompting you to {{{git push}}} your final changes to the remote
repository.
  
+ You may want to consider doing {{{git merge --squash master}}} - this will merge all commits
from master into a single commit locally. Then when you commit the changes to your branch,
the branch history won't become polluted with commits that didn't originate from the branch.
+ 
  === Merging Your Branch with master ===
  
- <!> TBD <!>
+ When your feature is complete, and you want to merge the branch to master, you definitely
want to do a squash merge so all of the little commits you made in the branch don't pollute
the project master history.
+ 
+ You may also want to merge with master only after doing one last merge of master to your
branch. This will allow you to resolve conflicts in your branch before having to deal with
them on master, and will make this process cleaner.
+ 
+ Be sure you have run {{{ant precommit}}} on your branch to find any unexpected problems.
Best to resolve those on your branch instead of waiting for Jenkins builds to fail, or other
committers to notice problems. Running any tests you can is also preferred.
+ 
+ To merge your branch with master:
+ 
+  * {{{git checkout <branch>}}} - make sure you {{{git pull}}} to have the absolute
latest changes from the remote repository.
+  * {{{git checkout master}}} - also, pull to make sure to {{{git pull}}} to have the absolute
latest changes from the remote repository.
+  * {{{git merge --squash <branch>}}} - this will merge your branch with master.
+ 
+ Hopefully you have minimal or maybe no conflicts. If so, resolve them. When you're ready:
+ 
+  * {{{git commit -m "Merging <branch> with master"}}}
+ 
+ Before you push your changes to master, run {{{ant precommit}}} and tests again to check
for anything unexpected.
+ 
+  * {{{git push}}}
+ 
+ That's it! Yeay!
  
  == IntelliJ notes ==
   * At least one problem with IntelliJ (Community edition, version 15) is that it seems to
get confused if you have both the SVN and Git plugins active at once. My (Erick Erickson)
issues cleared up when I disabled the svn plugin.

Mime
View raw message