gitcopier 0.1.6 → 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +38 -1
- data/lib/gitcopier/decisions.rb +7 -4
- data/lib/gitcopier/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1459f37974c679525b20246589a0bb9dde5f4183
|
4
|
+
data.tar.gz: 1212b30c675341533421b6548f906adff72402cb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9a363419cf6532870c302c27bc4c07e1bbb34db582402642f25da46f1663716b22cb1f0712932c893a141851f992db73c12aab8550d024fdd380e0a6e504c9b2
|
7
|
+
data.tar.gz: 87762d540a66695c99bf87fd829f5283f528c3df6fb5baf517f36ead1f6e2be9c8fe01b7f0181c32ba1314b912bd98566418bf8151f3059a75f341b9a4c103df
|
data/README.md
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# Gitcopier
|
2
2
|
Sometime, you work for a Rails project but its front end is adopted from other repositories (such as separated repository from a front end developer who is not familiar with Rails) and you need to integrate front end changes to the project. You need to see what files were changed, copy them accordingly. This gem will help you do the job really fast.
|
3
3
|
|
4
|
+
[![Gem Version](https://badge.fury.io/rb/gitcopier.svg)](https://badge.fury.io/rb/gitcopier)
|
4
5
|
## Installation
|
5
6
|
|
6
7
|
Add this line to your application's Gemfile:
|
@@ -17,9 +18,45 @@ Or install it yourself as:
|
|
17
18
|
|
18
19
|
$ gem install gitcopier
|
19
20
|
|
21
|
+
## Motivation
|
22
|
+
Imagine you are a Rails developer, your expertise is designing and developing
|
23
|
+
backend logic so you have one or more front end developers to help you with
|
24
|
+
design, javascript, stylesheet ... However, they are working in Nodejs environment
|
25
|
+
which is pretty different to Rails environment thus they have different repository.
|
26
|
+
In order to apply (integrate) changes from that repository, you might have to see what files were changed, copy them to appropriate places in your Rails repository.
|
27
|
+
Doing so is really annoying. You should have a better way of doing it.
|
28
|
+
|
29
|
+
## How Gitcopier work
|
30
|
+
Gitcopier helps you in intergrating those changes. Whenever you pull from front-end
|
31
|
+
repository, Gitcopier will ask you to decide where to copy changed file
|
32
|
+
(modified, added). It remembers your dicisions to automatically copy or not copy
|
33
|
+
in the future without asking you. This way, if front-end developers commit a
|
34
|
+
change to existing files, you just have to pull that repository and Gitcopier will
|
35
|
+
do all copying works.
|
36
|
+
|
20
37
|
## Usage
|
38
|
+
### Tell Gitcopier your repositories
|
39
|
+
```
|
40
|
+
gitcopier --from <path_to_external_repo> --to <path_to_main_repo>
|
41
|
+
```
|
42
|
+
where:
|
43
|
+
1. `<path_to_external_repo>`: is absolute path to the repository that you
|
44
|
+
want `Gitcopier` to copy files from. This repo must be under git control.
|
45
|
+
2. `<path_to_main_repo>`: is absolute path to the repository that you want
|
46
|
+
`Gitcopier` to copy files to.
|
21
47
|
|
22
|
-
|
48
|
+
> Note: `gitcopier -h` for help
|
49
|
+
```
|
50
|
+
gitcopier -h
|
51
|
+
Usage: gitcopier [options]
|
52
|
+
--from [path] Absolute path to your local repository that you want to copy from. This option must go with --to.
|
53
|
+
--to [path] Absolute path to your local repository that you want to copy to. This option must go with --from.
|
54
|
+
-v, --version
|
55
|
+
--showall Show all integration information. This option ignore any other options.
|
56
|
+
```
|
57
|
+
### Working with git merge
|
58
|
+
After you `git pull` in external repository, `Gitcopier` will prompt your decision
|
59
|
+
where to copy the changed files.
|
23
60
|
|
24
61
|
## Contributing
|
25
62
|
|
data/lib/gitcopier/decisions.rb
CHANGED
@@ -4,8 +4,6 @@ require 'gitcopier/decision'
|
|
4
4
|
|
5
5
|
module Gitcopier
|
6
6
|
class Decisions
|
7
|
-
DECISION_FILE = File.dirname(__FILE__) + '/' + 'decisions/decisions.json'
|
8
|
-
|
9
7
|
def initialize(source_root, des_root)
|
10
8
|
@source_root = source_root
|
11
9
|
@des_root = des_root
|
@@ -24,7 +22,7 @@ module Gitcopier
|
|
24
22
|
end
|
25
23
|
|
26
24
|
def save
|
27
|
-
File.write(
|
25
|
+
File.write(decision_file, JSON.pretty_generate(@decisions))
|
28
26
|
end
|
29
27
|
|
30
28
|
def get(changed_file)
|
@@ -32,7 +30,7 @@ module Gitcopier
|
|
32
30
|
end
|
33
31
|
|
34
32
|
def get_data_from_file
|
35
|
-
File.read(
|
33
|
+
File.read(decision_file)
|
36
34
|
end
|
37
35
|
|
38
36
|
def prompt_decision(changed_file)
|
@@ -72,5 +70,10 @@ module Gitcopier
|
|
72
70
|
end
|
73
71
|
true
|
74
72
|
end
|
73
|
+
|
74
|
+
private
|
75
|
+
def decision_file
|
76
|
+
File.join(@des_root, '.gitcopier_decisions.json')
|
77
|
+
end
|
75
78
|
end
|
76
79
|
end
|
data/lib/gitcopier/version.rb
CHANGED