Skip to content

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

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ecoffey
Copy link

@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
Copy link
Owner

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

@ecoffey
Copy link
Author

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
Copy link
Author

ecoffey commented Sep 26, 2012

Squashed :-) (sorry for the delay there)

@RaymondCrandall
Copy link

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
Copy link
Author

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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants