Project

General

Profile

Actions

Defect #5628

closed

Wrong commit range in git log command

Added by Sheng Wang almost 14 years ago. Updated about 13 years ago.

Status:
Closed
Priority:
Normal
Category:
SCM
Target version:
Start date:
2010-06-01
Due date:
% Done:

100%

Estimated time:
Resolution:
Affected version:

Description

Special file:

lib/redmine/scm/adapters/git_adapter.rb

Special coding:
def revisions(path, identifier_from, identifier_to, options={})
  revisions = Revisions.new
  cmd = "#{GIT_BIN} --git-dir #{target('')} log --raw --date=iso --pretty=fuller" 
  cmd << " --reverse" if options[:reverse]
  cmd << " --all" if options[:all]
  cmd << " -n #{options[:limit]} " if options[:limit]
  cmd << " #{shell_quote(identifier_from + '..')} " if identifier_from
  cmd << " #{shell_quote identifier_to} " if identifier_to

the correct git log command are following:

git log identifier_from..identifier_to

but the above coding result is

git log identifier_from..  identifier_to

It lead to that all log from identifier_from will be displayed. All of these are caused by extra spaces, which leads to git ignore identifier_to as the limit of the range.

Example:

git log 2efdef32^..2efdef32
Only 2efdef32 commit will be displayed.

git log 2efdef32^..  2efdef32
All commits from 2efdef32 will displayed.


Files

0001-git_adapter.rb-Fix-whitespace-in-git-command.patch (1.56 KB) 0001-git_adapter.rb-Fix-whitespace-in-git-command.patch S. Christoffer Eliesen, 2010-06-24 22:41
5628_git.diff (1.94 KB) 5628_git.diff Jean-Baptiste Barth, 2010-06-26 11:45

Related issues

Related to Redmine - Defect #7657: Wrong commit range in git log command on WindowsClosedToshi MARUYAMA2011-02-18

Actions
Actions

Also available in: Atom PDF