Adds Git.logBetween(from, to, callback) #9

Open
wants to merge 1 commit into
from

Projects

None yet

3 participants

@ecoffey
ecoffey commented Jun 9, 2012

I needed to get the log between two refspecs, and that's what Git.logBetween allows.

Given a from refspec, and a to refspec it returns an array of commit hashes, ordered by commit time.

I lifted the parsing of an individual line of the summary log from logFile, but only for use in logBetween, since that would technically change the resulting hash if used in logFile.

If you're happy with this as a start, I can finish that refactoring for logFile to use parseSummaryLogEntry, and add some tests for logBetween

@creationix
Owner

Can you squash this? 6 commits seems like a bit much for a ~30 line patch.

@ecoffey
ecoffey commented Jun 11, 2012

I can squash it into a new branch + pr if you'd like, or you can squash when you do the merge whichever works for you :-)

@ecoffey
ecoffey commented Sep 26, 2012

Squashed :-) (sorry for the delay there)

@RaymondCrandall

Hi Tim, when you asked Eoin if he could squash the commits, is that the same as compressing the history of changes made? What would the git command for that be?

Perhaps, this?
http://stackoverflow.com/questions/598672/git-how-to-squash-the-first-two-commits

@ecoffey
ecoffey commented Mar 18, 2013

Hey @RaymondCrandall "sqaush" can mean a few different things.

In this case, I did an interactive rebase (rebase -i) and chose the "squash" option for each commit, reducing N commits into 1 commit.

There is also the merge --squash option when merging a branch, which takes all of the N commits in the from branch and replays them against your working copy + index leaving your index a state that represent all of the commits from that branch ready for one commit.

git help merge and git help rebase are pretty useful as is the git-scm book http://git-scm.com/book

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment