git-whence 0.1.2 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e10de9d0d61af77edf2f36e586fe91ec33693648
4
- data.tar.gz: 381164b5f26998b6f6e3c665666f4f653425fe5a
3
+ metadata.gz: 7086aa5c3bbc94e5f5a842c43e88669ded5738b5
4
+ data.tar.gz: 0e22874dd8b2ec5d8e628ab18c72f453beb65044
5
5
  SHA512:
6
- metadata.gz: 171d8e85b32587b9077c83dcaca460918d196ce22f0e206ed2e821c132b53d028d9b4a9a3a3eee1e40f88476bf0c5f2bcde3204886ffedd9573f0da4c1decfe3
7
- data.tar.gz: 2b1f4de02c903ab33576369f88889fdeb69c073c0d174f3021923d44fb77d6c94a6a8815866bf84221b30e9b1314f489bfc4a8d9d7ab10999c01858f98839f23
6
+ metadata.gz: 2bcfce0b66afbac623de6721ab12b0025f1742bc0cafe6c23ce2cead5ef26ad6c912effdaff3d29ffd879bc63eba3321707b68ea9482dc5a22b2e82b30b03179
7
+ data.tar.gz: bdd79fe9fe66d32b94bebfce7e792635c12ff12db101397065a08bba1578b4b7cb8e36f42b5246871575bde9b7959f319bfee873acc590ebccd827ab6b760fe4
Binary file
data.tar.gz.sig CHANGED
@@ -1,3 +1 @@
1
- 4(_%�5�c���[�����S3m��pcg�RL�9��w�r�&N8�Dj�4z�<��= �����A�0�$����-�m�&F��\S%Q�KT�uG]���]-6�ӧ�Ҟ�/nhb�偁�r�����Ǭ�Xh��\��ڝ����@�����F]ah@N�/�U#o��bOA���� �GxDRE��� �z�^����FI�QI�^gkeDV?� �J�,
2
- e�b�8u�/���ӹ�����
3
- �z)��.
1
+ Ƃ����*�}���4E"�L3�i���͉�C����<��LE΃B*��S����J�ϓrT����J�7��~F-!�5�#��/m!��=��C��-��i���zX��2���g ����zѐ����ߑ1Y�1{�H��LŝԻZ���)`�q+u:�FQ}G�1zdv��E�:�v��%4o�����N�Ƒ��s�(��b%��/7�t���])Y
@@ -12,6 +12,8 @@ module Git::Whence
12
12
  return 1
13
13
  end
14
14
 
15
+ commit = expand(commit)
16
+
15
17
  if is_merge?(commit)
16
18
  $stderr.puts "Commit is a merge"
17
19
  finished_with_commit(commit, options)
@@ -30,6 +32,10 @@ module Git::Whence
30
32
 
31
33
  private
32
34
 
35
+ def expand(commit)
36
+ sh("git show #{commit} -s --format='%H'").strip
37
+ end
38
+
33
39
  def is_merge?(commit)
34
40
  sh("git cat-file -p #{commit}").split("\n")[1..2].grep(/parent /).size > 1
35
41
  end
@@ -58,8 +64,8 @@ module Git::Whence
58
64
  end
59
65
 
60
66
  def merge_include_commit?(merge, commit)
61
- commit = sh("git show HEAD -s --format=%h").strip if commit == "HEAD"
62
- sh("git log #{merge.strip}^..#{merge.strip} --pretty=%h").split("\n").include?(commit)
67
+ commit = sh("git show HEAD -s --format=%H").strip if commit == "HEAD"
68
+ sh("git log #{merge.strip}^..#{merge.strip} --pretty=%H").split("\n").include?(commit)
63
69
  end
64
70
 
65
71
  def find_merge_fuzzy(commit, branch)
@@ -72,13 +78,13 @@ module Git::Whence
72
78
  month = 30 * 24 * 60 * 60
73
79
  time, search = sh("git show -s --format='%ct %an %s' #{commit}").strip.split(" ", 2)
74
80
  time = time.to_i
75
- same = sh("git log #{branch} --pretty=format:'%h %an %s' --before #{time + month} --after #{time - month}")
81
+ same = sh("git log #{branch} --pretty=format:'%H %an %s' --before #{time + month} --after #{time - month}")
76
82
  found = same.split("\n").map { |x| x.split(" ", 2) }.detect { |commit, message| message == search }
77
83
  found && found.first
78
84
  end
79
85
 
80
86
  def find_merge_simple(commit, branch)
81
- result = sh "git log #{commit}..#{branch} --ancestry-path --merges --pretty='%h' 2>/dev/null | tail -n 1"
87
+ result = sh "git log #{commit}..#{branch} --ancestry-path --merges --pretty='%H' 2>/dev/null | tail -n 1"
82
88
  [commit, result] unless result.strip.empty?
83
89
  end
84
90
 
@@ -1,5 +1,5 @@
1
1
  module Git
2
2
  module Whence
3
- VERSION = "0.1.2"
3
+ VERSION = "0.1.3"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: git-whence
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Grosser
@@ -30,7 +30,7 @@ cert_chain:
30
30
  F5etKHZg0j3eHO31/i2HnswY04lqGImUu6aM5EnijFTB7PPW2KwKKM4+kKDYFdlw
31
31
  /0WV1Ng2/Y6qsHwmqGg2VlYj2h4=
32
32
  -----END CERTIFICATE-----
33
- date: 2014-05-17 00:00:00.000000000 Z
33
+ date: 2014-07-03 00:00:00.000000000 Z
34
34
  dependencies: []
35
35
  description:
36
36
  email: michael@grosser.it
@@ -53,17 +53,17 @@ require_paths:
53
53
  - lib
54
54
  required_ruby_version: !ruby/object:Gem::Requirement
55
55
  requirements:
56
- - - '>='
56
+ - - ">="
57
57
  - !ruby/object:Gem::Version
58
58
  version: '0'
59
59
  required_rubygems_version: !ruby/object:Gem::Requirement
60
60
  requirements:
61
- - - '>='
61
+ - - ">="
62
62
  - !ruby/object:Gem::Version
63
63
  version: '0'
64
64
  requirements: []
65
65
  rubyforge_project:
66
- rubygems_version: 2.0.14
66
+ rubygems_version: 2.2.2
67
67
  signing_key:
68
68
  specification_version: 4
69
69
  summary: Find the merge and pull request a commit came from + find cherry-picks
metadata.gz.sig CHANGED
Binary file