git_checker 0.0.3 → 0.0.4

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.
data/README.markdown CHANGED
@@ -2,9 +2,7 @@ Git Checker
2
2
  ===========
3
3
  screenshot: http://dl.dropbox.com/u/5847684/Screen%20shot%202011-06-30%20at%201.05.43%20PM.png
4
4
 
5
- It is useful for keep an eye on your git repositories, what branch has been not merged yet, commits not in some branch and more.
6
-
7
- "It's like a Test for your git"
5
+ The target of this gem is make easy the checks over your git repositories.
8
6
 
9
7
  Install:
10
8
  --------
@@ -14,7 +12,7 @@ Install:
14
12
  Usage:
15
13
  ------
16
14
 
17
- Create a file with the extension .gck.rb
15
+ Create a file with the extension .gck.rb in the root of your project
18
16
 
19
17
  touch checkthis.gck.rb
20
18
 
@@ -26,7 +24,7 @@ Add some checks in that file, like:
26
24
  print_commits_not_in local.branches['master'], local
27
25
  ```
28
26
 
29
- Then run the command:
27
+ **Then run the command in the directory:**
30
28
  `gck`
31
29
 
32
30
  Available Checks:
@@ -59,8 +57,20 @@ You can also ask for run task that you not always want, like this:
59
57
 
60
58
  You can skip this questions an run all with the command `agck`
61
59
 
60
+ Log format
61
+ ----------
62
+
63
+ By default it uses the standard log format, with color. You can add a `gck` section in your `~/.gitconfig` file to change it:
64
+
65
+ ```
66
+ [gck]
67
+ format = "--pretty=format:'%Cblue%h%Creset -%C(yellow)%d%Creset %s - %C(yellow)%aN%Creset %Cgreen(%cr)%Creset' --abbrev-commit --date=relative"
68
+ ```
69
+
70
+ Screenshot: http://dl.dropbox.com/u/2247903/gck-custom-log.png
71
+
62
72
  Please:
63
73
  -------
64
74
  Feedback.
65
75
 
66
- note: the merges should be done with `--no-ff` option for create a commit message in every merge.
76
+ note: the merges should be done with `--no-ff` option for create a commit message in every merge.
data/lib/branch.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  class Branch
2
-
2
+
3
3
  attr_accessor :name, :repo
4
4
 
5
5
  def initialize name, repo=nil
@@ -12,16 +12,22 @@ class Branch
12
12
  end
13
13
 
14
14
  def log_merges
15
- `git log #{full_repo_name @repo}#{@name} --merges`
15
+ `git log #{format} #{full_repo_name @repo}#{@name} --merges`
16
+ end
17
+
18
+ def format
19
+ format = `git config --get gck.format 2> /dev/null`.strip
20
+ return format unless format.empty?
21
+ "--color"
16
22
  end
17
23
 
18
24
  def commits_not_merged_from branch
19
- `git log --color #{full_repo_name @repo}#{@name}..#{full_repo_name(branch.repo)}#{branch.name}`
25
+ `git log #{format} #{full_repo_name @repo}#{@name}..#{full_repo_name(branch.repo)}#{branch.name}`
20
26
  end
21
27
 
22
28
  private
23
-
29
+
24
30
  def full_repo_name repo
25
31
  "#{repo}/" if repo
26
32
  end
27
- end
33
+ end
@@ -1,3 +1,3 @@
1
1
  module GitChecker
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: git_checker
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-09-13 00:00:00.000000000Z
12
+ date: 2011-09-23 00:00:00.000000000Z
13
13
  dependencies: []
14
14
  description: Using git_checker you can make scripts for perform checks over your git
15
15
  repositories easily
@@ -22,7 +22,6 @@ extensions: []
22
22
  extra_rdoc_files: []
23
23
  files:
24
24
  - .gitignore
25
- - Gemfile
26
25
  - README.markdown
27
26
  - Rakefile
28
27
  - bin/agck
data/Gemfile DELETED
@@ -1,4 +0,0 @@
1
- source "http://rubygems.org"
2
-
3
- # Specify your gem's dependencies in git_checker.gemspec
4
- gemspec