Signed-off-by: Felipe Contreras <felipe.contreras@xxxxxxxxx> --- contrib/related/git-related | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/contrib/related/git-related b/contrib/related/git-related index 0015b3c..2f38ee1 100755 --- a/contrib/related/git-related +++ b/contrib/related/git-related @@ -126,6 +126,20 @@ class Commits def from_rev_args(args) return if args.empty? + + revs = [] + + File.popen(%w[git rev-parse --revs-only --default=HEAD --symbolic] + args).each do |rev| + revs << rev.chomp + end + + case revs.size + when 1 + committish = [ '%s..HEAD' % revs[0] ] + else + committish = revs + end + source = nil File.popen(%w[git rev-list --reverse] + args) do |p| p.each do |e| -- 1.8.2.1 -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html