gitfog 0.0.2 → 0.0.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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +55 -0
  3. data/bin/gitfog +6 -5
  4. metadata +3 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8f3ea0fda38a314d83cd471b96422c8f3068723b
4
- data.tar.gz: a06c61e02bd8b13916d78a9bb2e572e8516a1546
3
+ metadata.gz: 41e92b60e2a5fa3dca3c599406c89ec1b3a17b51
4
+ data.tar.gz: affff66f10fe8c66a4a24f332e8c73655b3fb614
5
5
  SHA512:
6
- metadata.gz: 696d0b097b30d4529d1dca55686b759466c01f28515dc1b478fbe79a057050800cb41e64820691394ab7ef5615e187998357dcbd6863e2da4242582e358eb4d6
7
- data.tar.gz: 195f79230bfa7dee63ffae0bd66dc10c06804505c440232a3912efa7609b08ed94ac41d523a33137c9c4ae6a3fd972fc74da3a89ab967921df0bad5787fc3301
6
+ metadata.gz: 3941a269db18a1bed4d7fa61d2e3497e4f59b5a039a60740947378eb3d1c474ef7c21d7cfe9df20e47e4084451b39f7caa714f5a8be1987ba5b527fd1db046a5
7
+ data.tar.gz: bc9c81cf17c4e862e17c61cf4088c496764a520c55218e26e1bcf0cfd6cdcb28516ccfd9c77b8b5bd72654b1fdc0f157764d21f8a8d402380921f2b480a76846
data/README.md ADDED
@@ -0,0 +1,55 @@
1
+ # GitFog
2
+
3
+ Inspired by <a href="http://bitcoinfog.com/">Bitcoin Fog</a>, GitFog is a
4
+ command line tool that camouflages your work with git by randomizing timestamps on
5
+ ```git commit``` and ```git push```.
6
+
7
+ ## Use case
8
+
9
+ When you contribute code with git, you share your name, email, and work schedule with
10
+ everyone. GitFog helps you change your git/config, then goes further to better anonymize
11
+ your work. Suppose someone suspects that you are involved, and finds out that you often
12
+ commit to personal projects on Tuesday afternoons. They would examine whether your commits and
13
+ pushes happen at similar days and times as others. By using GitFog, your commits are spaced
14
+ out and randomized.
15
+
16
+ ## Alternatives
17
+
18
+ The easiest option would be to schedule a commit and push at a regular time
19
+ (for example, 3am every morning) but this requires you to have the computer
20
+ always running, makes it obvious that you are scheduling your commits, and
21
+ any immediate commits and pushes (ie to fix a bug on the site) will break
22
+ the pattern.
23
+
24
+ ## How to install GitFog
25
+
26
+ Have Ruby and RubyGems installed on your computer.
27
+
28
+ Then run ```gem install gitfog```
29
+
30
+ Currently at version 0.0.3
31
+
32
+ ## How to use GitFog
33
+
34
+ ```gitfog init``` will disable git and enable gitfog commands. This prevents
35
+ you from using the regular git commands by habit. You will be asked to set
36
+ a user email and password to connect to commits (this prevents you from
37
+ leaking your global git config though commits)
38
+
39
+ ```gitfog off``` will disable gitfog and re-enable git commands. Make sure
40
+ you do not commit data that you do not want to be shared. You can always re-enable
41
+ GitFog with ```gitfog init```.
42
+
43
+ ```gitfog status```, ```gitfog add```, and ```gitfog rm``` replace the standard git
44
+ commands.
45
+
46
+ ```gitfog commit``` will set the timestamp on your commit to sometime between
47
+ the previous commit and the present, up to 48 hours in the past. This makes
48
+ it possible for you to make a few commits in quick succession which in the
49
+ timescale may be spaced out over several hours. The timestamp will not affect
50
+ the order of commits. ```gitfog commit --now``` will use your system time.
51
+
52
+ ```gitfog push``` will hold your push for a random time in the next 8 hours.
53
+ You can cancel the push with Ctrl+C, make an immediate push with
54
+ ```gitfog push --now```, or change the maximum time with
55
+ ```gitfog push --max 4```.
data/bin/gitfog CHANGED
@@ -7,7 +7,7 @@ require 'highline/import'
7
7
  require 'fileutils'
8
8
  require 'git'
9
9
 
10
- program :version, '0.0.2'
10
+ program :version, '0.0.3'
11
11
  program :description, 'Camouflage git commit and push'
12
12
 
13
13
  def verify_gitfog
@@ -216,8 +216,9 @@ command :commit do |c|
216
216
  last_commit = Time.now - 48 * 60 * 60
217
217
  begin
218
218
  repo.log(1).each do |commit|
219
- # actually returns a Time object
220
- last_commit = commit.date
219
+ # commit.date actually returns a Time object
220
+ # use it as earliest time unless it is already > 48 hours ago
221
+ last_commit = commit.date if commit.date > last_commit
221
222
  end
222
223
  rescue
223
224
  # usually means a repo has no prior commits
@@ -245,7 +246,7 @@ command :commit do |c|
245
246
  if ok_to_commit
246
247
  # choose a past time
247
248
  seconds_diff = Time.now - last_commit
248
- commit_time = last_commit + Random.rand(0..seconds_diff)
249
+ commit_time = last_commit + Random.rand(1..seconds_diff)
249
250
  commit_time = commit_time.to_s
250
251
  puts "Backdating to the commit to " + commit_time
251
252
 
@@ -292,7 +293,7 @@ command :push do |c|
292
293
  # get maximum delay from user
293
294
  delay_push = options.limit * 60 * 60
294
295
  end
295
- delay_push = Random.rand(0..delay_push)
296
+ delay_push = Random.rand(2..delay_push)
296
297
  push_time = Time.now + delay_push
297
298
  puts "Delaying push " + delay_push.to_s + " seconds, until " + push_time.to_s
298
299
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gitfog
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Msjoinder
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-11 00:00:00.000000000 Z
11
+ date: 2014-01-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: commander
@@ -73,6 +73,7 @@ executables:
73
73
  extensions: []
74
74
  extra_rdoc_files: []
75
75
  files:
76
+ - README.md
76
77
  - bin/gitfog
77
78
  - lib/gitfog.rb
78
79
  homepage: https://github.com/msjoinder/gitfog