git-remote-dropbox 2.0.0__tar.gz → 2.0.2__tar.gz

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 (23) hide show
  1. {git-remote-dropbox-2.0.0 → git-remote-dropbox-2.0.2}/LICENSE.md +1 -1
  2. git-remote-dropbox-2.0.2/PKG-INFO +199 -0
  3. {git-remote-dropbox-2.0.0 → git-remote-dropbox-2.0.2}/README.md +12 -2
  4. {git-remote-dropbox-2.0.0 → git-remote-dropbox-2.0.2}/git_remote_dropbox/__init__.py +2 -2
  5. {git-remote-dropbox-2.0.0 → git-remote-dropbox-2.0.2}/git_remote_dropbox/cli/manage.py +1 -1
  6. {git-remote-dropbox-2.0.0 → git-remote-dropbox-2.0.2}/git_remote_dropbox/helper.py +18 -14
  7. git-remote-dropbox-2.0.2/git_remote_dropbox.egg-info/PKG-INFO +199 -0
  8. {git-remote-dropbox-2.0.0 → git-remote-dropbox-2.0.2}/git_remote_dropbox.egg-info/SOURCES.txt +0 -1
  9. {git-remote-dropbox-2.0.0 → git-remote-dropbox-2.0.2}/git_remote_dropbox.egg-info/entry_points.txt +0 -1
  10. {git-remote-dropbox-2.0.0 → git-remote-dropbox-2.0.2}/git_remote_dropbox.egg-info/requires.txt +1 -0
  11. {git-remote-dropbox-2.0.0 → git-remote-dropbox-2.0.2}/setup.cfg +0 -3
  12. {git-remote-dropbox-2.0.0 → git-remote-dropbox-2.0.2}/setup.py +1 -0
  13. git-remote-dropbox-2.0.0/PKG-INFO +0 -187
  14. git-remote-dropbox-2.0.0/git_remote_dropbox.egg-info/PKG-INFO +0 -187
  15. {git-remote-dropbox-2.0.0 → git-remote-dropbox-2.0.2}/git_remote_dropbox/cli/__init__.py +0 -0
  16. {git-remote-dropbox-2.0.0 → git-remote-dropbox-2.0.2}/git_remote_dropbox/cli/common.py +0 -0
  17. {git-remote-dropbox-2.0.0 → git-remote-dropbox-2.0.2}/git_remote_dropbox/cli/helper.py +0 -0
  18. {git-remote-dropbox-2.0.0 → git-remote-dropbox-2.0.2}/git_remote_dropbox/constants.py +0 -0
  19. {git-remote-dropbox-2.0.0 → git-remote-dropbox-2.0.2}/git_remote_dropbox/git.py +0 -0
  20. {git-remote-dropbox-2.0.0 → git-remote-dropbox-2.0.2}/git_remote_dropbox/util.py +0 -0
  21. {git-remote-dropbox-2.0.0 → git-remote-dropbox-2.0.2}/git_remote_dropbox.egg-info/dependency_links.txt +0 -0
  22. {git-remote-dropbox-2.0.0 → git-remote-dropbox-2.0.2}/git_remote_dropbox.egg-info/top_level.txt +0 -0
  23. {git-remote-dropbox-2.0.0 → git-remote-dropbox-2.0.2}/pyproject.toml +0 -0
@@ -1,7 +1,7 @@
1
1
  The MIT License (MIT)
2
2
  =====================
3
3
 
4
- **Copyright (c) 2015-2022 Anish Athalye (me@anishathalye.com)**
4
+ **Copyright (c) Anish Athalye (me@anishathalye.com)**
5
5
 
6
6
  Permission is hereby granted, free of charge, to any person obtaining a copy of
7
7
  this software and associated documentation files (the "Software"), to deal in
@@ -0,0 +1,199 @@
1
+ Metadata-Version: 2.1
2
+ Name: git-remote-dropbox
3
+ Version: 2.0.2
4
+ Summary: A transparent bidirectional bridge between Git and Dropbox
5
+ Home-page: https://github.com/anishathalye/git-remote-dropbox
6
+ Author: Anish Athalye
7
+ Author-email: me@anishathalye.com
8
+ License: MIT
9
+ Keywords: git dropbox
10
+ Classifier: Development Status :: 5 - Production/Stable
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: Topic :: Software Development :: Version Control
13
+ Classifier: License :: OSI Approved :: MIT License
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.6
16
+ Classifier: Programming Language :: Python :: 3.7
17
+ Classifier: Programming Language :: Python :: 3.8
18
+ Classifier: Programming Language :: Python :: 3.9
19
+ Classifier: Programming Language :: Python :: 3.10
20
+ Description-Content-Type: text/markdown
21
+ License-File: LICENSE.md
22
+ Requires-Dist: dropbox<12,>=11
23
+ Requires-Dist: setuptools
24
+
25
+ # git-remote-dropbox [![Build Status](https://github.com/anishathalye/git-remote-dropbox/workflows/CI/badge.svg)](https://github.com/anishathalye/git-remote-dropbox/actions?query=workflow%3ACI) [![pypi](https://img.shields.io/pypi/v/git-remote-dropbox.svg)](https://pypi.org/pypi/git-remote-dropbox/)
26
+
27
+ git-remote-dropbox is a transparent bidirectional bridge between Git and
28
+ Dropbox. It lets you use a Dropbox folder or a shared folder as a Git remote!
29
+
30
+ ---
31
+
32
+ This Git remote helper makes Dropbox act like a _true Git remote_. It maintains
33
+ _all guarantees_ that are provided by a traditional Git remote while using
34
+ Dropbox as a backing store. This means that it works correctly even when there
35
+ are multiple people operating on the repository at once, making it possible to
36
+ use a Dropbox shared folder as a Git remote for collaboration.
37
+
38
+ Once the helper is installed, using it is as simple as adding a remote like
39
+ `dropbox:///path/to/repo`.
40
+
41
+ To clone repositories in folders or shared folders mounted in your Dropbox, you
42
+ can run:
43
+
44
+ ```bash
45
+ git clone "dropbox:///path/to/repo"
46
+ ```
47
+
48
+ To add a remote to an existing local repository, you can run:
49
+
50
+ ```bash
51
+ git remote add origin "dropbox:///path/to/repo"
52
+ ```
53
+
54
+ The repository directory will be created automatically the first time you push.
55
+
56
+ After adding the remote, you can treat it just like a regular Git remote. The
57
+ Dropbox-backed remote supports all operations that regular remotes support, and
58
+ it provides identical guarantees in terms of atomicity even when there are
59
+ concurrent operations, even when using a shared folder.
60
+
61
+ ## Setup
62
+
63
+ ### Install git-remote-dropbox
64
+
65
+ 1. Prerequisites:
66
+ 1. `python` and matching `pip`
67
+ 2. `git`
68
+ 2. Install this package with `pip install git-remote-dropbox`. Use `which git-remote-dropbox` to make sure it's available via `$PATH`. If not, edit `$PATH` appropriately.
69
+
70
+ ### Log in to Dropbox
71
+
72
+ Run `git dropbox login` and follow the instructions to authenticate with OAuth
73
+ and log in to your Dropbox account.
74
+
75
+ ## Sharing
76
+
77
+ The above gives you a way to create a Git repository on Dropbox and use it from multiple machines that you own. In other words, it's a convenient way to share a remote with your laptop and your desktop.
78
+
79
+ If you want to share with other people, you should explicitly share (e.g. via the Dropbox website) the root folder of the repo with your collaborators. Then they should also install git-remote-dropbox and log in *with their own account*.
80
+
81
+ ## Multiple Accounts
82
+
83
+ git-remote-dropbox supports using multiple Dropbox accounts. You can have named
84
+ accounts with `git dropbox login <username>`. **These usernames are unrelated
85
+ to your Dropbox login; you can choose whatever names you want to organize your
86
+ accounts, e.g. "work".**
87
+
88
+ You can tell git-remote-dropbox to use a particular account by setting the git
89
+ remote URL appropriately, specifying a username like:
90
+ `dropbox://username@/path/to/repo`.
91
+
92
+ ## Repository Manager
93
+
94
+ In addition to the git remote helper, git-remote-dropbox comes with an
95
+ additional tool to manage your logins and repositories on Dropbox. This tool
96
+ can be invoked as `git dropbox`.
97
+
98
+ The tool supports the following commands:
99
+
100
+ - `git dropbox login [username]`: log in, either with the default account (no
101
+ need to specify a username in remote), or with an alias (for multi-account
102
+ support)
103
+ - `git dropbox logout [username]`: log out
104
+ - `git dropbox show-logins`: list logged-in accounts
105
+ - `git dropbox set-head <remote> <branch>`: set default branch on the remote
106
+ - `git dropbox version`: show version
107
+
108
+ ## Notes
109
+
110
+ - Do not directly interact with Git repositories in your Dropbox folder -always
111
+ use git-remote-dropbox. If you're using the Dropbox client to sync files,
112
+ it's a good idea to use [selective
113
+ sync](https://help.dropbox.com/installs-integrations/sync-uploads/selective-sync-overview)
114
+ and disable syncing of the folder containing the repository to avoid any
115
+ unexpected conflicts, just in case.
116
+
117
+ - git-remote-dropbox does not use the Dropbox desktop client - it uses the API
118
+ directly. It does not require that the desktop client is installed.
119
+
120
+ - The remote helper does not support shallow cloning.
121
+
122
+ - Cloning a repository or fetching a lot of objects produces lots of loose
123
+ objects. To save space in the local repository, run `git gc --aggressive`.
124
+
125
+ - If the remote HEAD (default branch on the remote) is not set, after cloning a
126
+ repository from Dropbox, Git will not automatically check out a branch. To
127
+ check out a branch, run `git checkout <branch>`. To set the default branch on
128
+ the remote, use the [`git dropbox`](#repository-manager) command.
129
+
130
+ ## FAQ
131
+
132
+ **Why shouldn't I keep my Git repository in Dropbox and let the client sync
133
+ it?**
134
+
135
+ There seem to be a lot of articles on the Internet recommending this as a good
136
+ workflow. However, this is *not a good idea*! The desktop client is not aware
137
+ of how Git manages it's on-disk format, so if there are concurrent changes or
138
+ delays in syncing, it's possible to have conflicts that result in a corrupted
139
+ Git repository. This may be uncommon with the way the timing works out in the
140
+ single user case, but it's still not safe!
141
+
142
+ **Why shouldn't I keep a bare Git repository in a Dropbox shared folder, use it
143
+ as a folder-based Git remote, and sync it with the desktop client?**
144
+
145
+ There seem to be some articles on the Internet suggesting that this is a good
146
+ idea. It's not. Using the desktop client to sync a bare Git repository is not
147
+ safe. Concurrent changes or delays in syncing can result in a corrupted Git
148
+ repository.
149
+
150
+ **How can I access / recover my repository from Dropbox without using the
151
+ git-remote-dropbox helper?**
152
+
153
+ Because git-remote-dropbox uses an on-disk format that's compatible with Git,
154
+ accessing your repository without using the helper is easy:
155
+
156
+ 1. Download the repository data (a directory containing the `objects` and
157
+ `refs` directories) from Dropbox.
158
+ 2. Make a new directory and initialize an empty Git repository in the
159
+ directory.
160
+ 3. Overwrite `.git/refs` and `.git/objects` in your newly initialized
161
+ repository with the data downloaded from Dropbox (using a command like `rm
162
+ -rf .git/{refs,objects} && cp -r /path/to/data/{refs,objects} .git/`).
163
+ 4. Check out a branch (using a command like `git checkout -f master`).
164
+ 5. Optionally, run `git gc --aggressive` to save disk space in your local
165
+ repository.
166
+
167
+ **How do I use git-remote-dropbox from behind a proxy server?**
168
+
169
+ You can use git-remote-dropbox from behind a proxy server by setting the
170
+ `HTTP_PROXY` and `HTTPS_PROXY` environment variables. See
171
+ [here](http://docs.python-requests.org/en/latest/user/advanced/#proxies) for
172
+ more details.
173
+
174
+ **How do I use git-remote-dropbox with submodules?**
175
+
176
+ You can allow this by setting
177
+ [`protocol.dropbox.allow`](https://git-scm.com/docs/git-config#Documentation/git-config.txt-protocolltnamegtallow)
178
+ to `always`:
179
+
180
+ ```bash
181
+ git config --global --add protocol.dropbox.allow always
182
+ ```
183
+
184
+ ## Design
185
+
186
+ To read about the design of git-remote-dropbox, see [DESIGN.md](DESIGN.md).
187
+ This could be especially useful if you're thinking about contributing to the
188
+ project.
189
+
190
+ ## Contributing
191
+
192
+ Do you have ideas on how to improve git-remote-dropbox? Have a feature request,
193
+ bug report, or patch? Great! See [CONTRIBUTING.md](CONTRIBUTING.md) for
194
+ information on what you can do about that.
195
+
196
+ ## License
197
+
198
+ Copyright (c) Anish Athalye. Released under the MIT License. See
199
+ [LICENSE.md](LICENSE.md) for details.
@@ -1,4 +1,4 @@
1
- # git-remote-dropbox [![Build Status](https://github.com/anishathalye/git-remote-dropbox/workflows/CI/badge.svg)](https://github.com/anishathalye/git-remote-dropbox/actions?query=workflow%3ACI)
1
+ # git-remote-dropbox [![Build Status](https://github.com/anishathalye/git-remote-dropbox/workflows/CI/badge.svg)](https://github.com/anishathalye/git-remote-dropbox/actions?query=workflow%3ACI) [![pypi](https://img.shields.io/pypi/v/git-remote-dropbox.svg)](https://pypi.org/pypi/git-remote-dropbox/)
2
2
 
3
3
  git-remote-dropbox is a transparent bidirectional bridge between Git and
4
4
  Dropbox. It lets you use a Dropbox folder or a shared folder as a Git remote!
@@ -147,6 +147,16 @@ You can use git-remote-dropbox from behind a proxy server by setting the
147
147
  [here](http://docs.python-requests.org/en/latest/user/advanced/#proxies) for
148
148
  more details.
149
149
 
150
+ **How do I use git-remote-dropbox with submodules?**
151
+
152
+ You can allow this by setting
153
+ [`protocol.dropbox.allow`](https://git-scm.com/docs/git-config#Documentation/git-config.txt-protocolltnamegtallow)
154
+ to `always`:
155
+
156
+ ```bash
157
+ git config --global --add protocol.dropbox.allow always
158
+ ```
159
+
150
160
  ## Design
151
161
 
152
162
  To read about the design of git-remote-dropbox, see [DESIGN.md](DESIGN.md).
@@ -161,5 +171,5 @@ information on what you can do about that.
161
171
 
162
172
  ## License
163
173
 
164
- Copyright (c) 2015-2022 Anish Athalye. Released under the MIT License. See
174
+ Copyright (c) Anish Athalye. Released under the MIT License. See
165
175
  [LICENSE.md](LICENSE.md) for details.
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2015-2022 Anish Athalye (me@anishathalye.com)
1
+ # Copyright (c) Anish Athalye (me@anishathalye.com)
2
2
  #
3
3
  # Permission is hereby granted, free of charge, to any person obtaining a copy
4
4
  # of this software and associated documentation files (the "Software"), to deal
@@ -18,4 +18,4 @@
18
18
  # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19
19
  # SOFTWARE.
20
20
 
21
- __version__ = "2.0.0"
21
+ __version__ = "2.0.2"
@@ -76,7 +76,7 @@ def set_head(remote: str, branch: str) -> None:
76
76
 
77
77
  remote_ref = "refs/heads/%s" % branch
78
78
 
79
- def branch_exists():
79
+ def branch_exists() -> bool:
80
80
  refs = helper.get_refs(False)
81
81
  for _, name in refs:
82
82
  if name == remote_ref:
@@ -22,7 +22,7 @@ import multiprocessing.pool
22
22
  import posixpath
23
23
  import sys
24
24
  import threading
25
- from typing import Optional, NoReturn, Tuple, Dict, List, Set
25
+ from typing import Optional, Union, NoReturn, Tuple, Dict, List, Set
26
26
 
27
27
  try:
28
28
  # Importing synchronize is to detect platforms where
@@ -30,7 +30,7 @@ try:
30
30
  # and cause an ImportError. Otherwise it will happen
31
31
  # later when trying to use Queue().
32
32
  from multiprocessing import synchronize as _
33
- from multiprocessing import Queue # type: ignore
33
+ from multiprocessing import Queue
34
34
  except ImportError:
35
35
  from queue import Queue # type: ignore
36
36
 
@@ -272,7 +272,7 @@ class Helper:
272
272
  Return a list of (revision number, content) for a given list of files.
273
273
  """
274
274
  pool = multiprocessing.dummy.Pool(self._processes)
275
- return pool.map(self._get_file, paths)
275
+ return pool.map(self._get_file, paths) # type: ignore
276
276
 
277
277
  def _put_object(self, sha: str) -> None:
278
278
  """
@@ -282,12 +282,12 @@ class Helper:
282
282
  path = self._object_path(sha)
283
283
  self._trace("writing: %s" % path)
284
284
  retries = 0
285
- mode = dropbox.files.WriteMode("overwrite")
285
+ mode = dropbox.files.WriteMode.overwrite
286
286
 
287
287
  if len(data) <= CHUNK_SIZE:
288
288
  while True:
289
289
  try:
290
- self._connection.files_upload(data, path, mode, mute=True)
290
+ self._connection.files_upload(data, path, mode, strict_conflict=True, mute=True)
291
291
  except dropbox.exceptions.InternalServerError:
292
292
  self._trace("internal server error writing %s, retrying" % sha)
293
293
  if retries < MAX_RETRIES:
@@ -314,7 +314,9 @@ class Helper:
314
314
  self._connection.files_upload_session_append_v2(chunk, cursor)
315
315
  else:
316
316
  # upload the last chunk
317
- commit_info = dropbox.files.CommitInfo(path, mode, mute=True)
317
+ commit_info = dropbox.files.CommitInfo(
318
+ path, mode, strict_conflict=True, mute=True
319
+ )
318
320
  self._connection.files_upload_session_finish(chunk, cursor, commit_info)
319
321
  done_uploading = True
320
322
 
@@ -335,7 +337,9 @@ class Helper:
335
337
  else:
336
338
  raise
337
339
 
338
- def _download(self, input_queue: Queue, output_queue: Queue) -> None:
340
+ def _download(
341
+ self, input_queue: "Queue[Union[str, Poison]]", output_queue: "Queue[Union[str, Poison]]"
342
+ ) -> None:
339
343
  """
340
344
  Download files given in input_queue and push results to output_queue.
341
345
  """
@@ -360,8 +364,8 @@ class Helper:
360
364
  queue = [sha]
361
365
  pending: Set[str] = set()
362
366
  downloaded: Set[str] = set()
363
- input_queue: Queue = Queue() # requesting downloads
364
- output_queue: Queue = Queue() # completed downloads
367
+ input_queue: "Queue[Union[str, Poison]]" = Queue() # requesting downloads
368
+ output_queue: "Queue[Union[str, Poison]]" = Queue() # completed downloads
365
369
  procs = []
366
370
  for _ in range(self._processes):
367
371
  target = Binder(self, "_download")
@@ -434,7 +438,7 @@ class Helper:
434
438
  path = self._ref_path(dst)
435
439
  if force:
436
440
  # overwrite regardless of what is there before
437
- mode = dropbox.files.WriteMode("overwrite")
441
+ mode = dropbox.files.WriteMode.overwrite
438
442
  else:
439
443
  info = self._refs.get(dst, None)
440
444
  if info:
@@ -449,11 +453,11 @@ class Helper:
449
453
  else:
450
454
  # perform an atomic add, which fails if a concurrent writer
451
455
  # writes before this does
452
- mode = dropbox.files.WriteMode("add")
456
+ mode = dropbox.files.WriteMode.add
453
457
  self._trace("writing ref %s with mode %s" % (dst, mode))
454
458
  data = ("%s\n" % new_sha).encode("utf8")
455
459
  try:
456
- self._connection.files_upload(data, path, mode, mute=True)
460
+ self._connection.files_upload(data, path, mode, strict_conflict=True, mute=True)
457
461
  except dropbox.exceptions.ApiError as e:
458
462
  if not isinstance(e.error, dropbox.files.UploadError):
459
463
  raise
@@ -516,11 +520,11 @@ class Helper:
516
520
  mode = dropbox.files.WriteMode.update(rev)
517
521
  else:
518
522
  # atomic add
519
- mode = dropbox.files.WriteMode("add")
523
+ mode = dropbox.files.WriteMode.add
520
524
  data = ("ref: %s\n" % ref).encode("utf8")
521
525
  self._trace("writing symbolic ref %s with mode %s" % (path, mode))
522
526
  try:
523
- self._connection.files_upload(data, path, mode, mute=True)
527
+ self._connection.files_upload(data, path, mode, strict_conflict=True, mute=True)
524
528
  return True
525
529
  except dropbox.exceptions.ApiError as e:
526
530
  if not isinstance(e.error, dropbox.files.UploadError):
@@ -0,0 +1,199 @@
1
+ Metadata-Version: 2.1
2
+ Name: git-remote-dropbox
3
+ Version: 2.0.2
4
+ Summary: A transparent bidirectional bridge between Git and Dropbox
5
+ Home-page: https://github.com/anishathalye/git-remote-dropbox
6
+ Author: Anish Athalye
7
+ Author-email: me@anishathalye.com
8
+ License: MIT
9
+ Keywords: git dropbox
10
+ Classifier: Development Status :: 5 - Production/Stable
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: Topic :: Software Development :: Version Control
13
+ Classifier: License :: OSI Approved :: MIT License
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.6
16
+ Classifier: Programming Language :: Python :: 3.7
17
+ Classifier: Programming Language :: Python :: 3.8
18
+ Classifier: Programming Language :: Python :: 3.9
19
+ Classifier: Programming Language :: Python :: 3.10
20
+ Description-Content-Type: text/markdown
21
+ License-File: LICENSE.md
22
+ Requires-Dist: dropbox<12,>=11
23
+ Requires-Dist: setuptools
24
+
25
+ # git-remote-dropbox [![Build Status](https://github.com/anishathalye/git-remote-dropbox/workflows/CI/badge.svg)](https://github.com/anishathalye/git-remote-dropbox/actions?query=workflow%3ACI) [![pypi](https://img.shields.io/pypi/v/git-remote-dropbox.svg)](https://pypi.org/pypi/git-remote-dropbox/)
26
+
27
+ git-remote-dropbox is a transparent bidirectional bridge between Git and
28
+ Dropbox. It lets you use a Dropbox folder or a shared folder as a Git remote!
29
+
30
+ ---
31
+
32
+ This Git remote helper makes Dropbox act like a _true Git remote_. It maintains
33
+ _all guarantees_ that are provided by a traditional Git remote while using
34
+ Dropbox as a backing store. This means that it works correctly even when there
35
+ are multiple people operating on the repository at once, making it possible to
36
+ use a Dropbox shared folder as a Git remote for collaboration.
37
+
38
+ Once the helper is installed, using it is as simple as adding a remote like
39
+ `dropbox:///path/to/repo`.
40
+
41
+ To clone repositories in folders or shared folders mounted in your Dropbox, you
42
+ can run:
43
+
44
+ ```bash
45
+ git clone "dropbox:///path/to/repo"
46
+ ```
47
+
48
+ To add a remote to an existing local repository, you can run:
49
+
50
+ ```bash
51
+ git remote add origin "dropbox:///path/to/repo"
52
+ ```
53
+
54
+ The repository directory will be created automatically the first time you push.
55
+
56
+ After adding the remote, you can treat it just like a regular Git remote. The
57
+ Dropbox-backed remote supports all operations that regular remotes support, and
58
+ it provides identical guarantees in terms of atomicity even when there are
59
+ concurrent operations, even when using a shared folder.
60
+
61
+ ## Setup
62
+
63
+ ### Install git-remote-dropbox
64
+
65
+ 1. Prerequisites:
66
+ 1. `python` and matching `pip`
67
+ 2. `git`
68
+ 2. Install this package with `pip install git-remote-dropbox`. Use `which git-remote-dropbox` to make sure it's available via `$PATH`. If not, edit `$PATH` appropriately.
69
+
70
+ ### Log in to Dropbox
71
+
72
+ Run `git dropbox login` and follow the instructions to authenticate with OAuth
73
+ and log in to your Dropbox account.
74
+
75
+ ## Sharing
76
+
77
+ The above gives you a way to create a Git repository on Dropbox and use it from multiple machines that you own. In other words, it's a convenient way to share a remote with your laptop and your desktop.
78
+
79
+ If you want to share with other people, you should explicitly share (e.g. via the Dropbox website) the root folder of the repo with your collaborators. Then they should also install git-remote-dropbox and log in *with their own account*.
80
+
81
+ ## Multiple Accounts
82
+
83
+ git-remote-dropbox supports using multiple Dropbox accounts. You can have named
84
+ accounts with `git dropbox login <username>`. **These usernames are unrelated
85
+ to your Dropbox login; you can choose whatever names you want to organize your
86
+ accounts, e.g. "work".**
87
+
88
+ You can tell git-remote-dropbox to use a particular account by setting the git
89
+ remote URL appropriately, specifying a username like:
90
+ `dropbox://username@/path/to/repo`.
91
+
92
+ ## Repository Manager
93
+
94
+ In addition to the git remote helper, git-remote-dropbox comes with an
95
+ additional tool to manage your logins and repositories on Dropbox. This tool
96
+ can be invoked as `git dropbox`.
97
+
98
+ The tool supports the following commands:
99
+
100
+ - `git dropbox login [username]`: log in, either with the default account (no
101
+ need to specify a username in remote), or with an alias (for multi-account
102
+ support)
103
+ - `git dropbox logout [username]`: log out
104
+ - `git dropbox show-logins`: list logged-in accounts
105
+ - `git dropbox set-head <remote> <branch>`: set default branch on the remote
106
+ - `git dropbox version`: show version
107
+
108
+ ## Notes
109
+
110
+ - Do not directly interact with Git repositories in your Dropbox folder -always
111
+ use git-remote-dropbox. If you're using the Dropbox client to sync files,
112
+ it's a good idea to use [selective
113
+ sync](https://help.dropbox.com/installs-integrations/sync-uploads/selective-sync-overview)
114
+ and disable syncing of the folder containing the repository to avoid any
115
+ unexpected conflicts, just in case.
116
+
117
+ - git-remote-dropbox does not use the Dropbox desktop client - it uses the API
118
+ directly. It does not require that the desktop client is installed.
119
+
120
+ - The remote helper does not support shallow cloning.
121
+
122
+ - Cloning a repository or fetching a lot of objects produces lots of loose
123
+ objects. To save space in the local repository, run `git gc --aggressive`.
124
+
125
+ - If the remote HEAD (default branch on the remote) is not set, after cloning a
126
+ repository from Dropbox, Git will not automatically check out a branch. To
127
+ check out a branch, run `git checkout <branch>`. To set the default branch on
128
+ the remote, use the [`git dropbox`](#repository-manager) command.
129
+
130
+ ## FAQ
131
+
132
+ **Why shouldn't I keep my Git repository in Dropbox and let the client sync
133
+ it?**
134
+
135
+ There seem to be a lot of articles on the Internet recommending this as a good
136
+ workflow. However, this is *not a good idea*! The desktop client is not aware
137
+ of how Git manages it's on-disk format, so if there are concurrent changes or
138
+ delays in syncing, it's possible to have conflicts that result in a corrupted
139
+ Git repository. This may be uncommon with the way the timing works out in the
140
+ single user case, but it's still not safe!
141
+
142
+ **Why shouldn't I keep a bare Git repository in a Dropbox shared folder, use it
143
+ as a folder-based Git remote, and sync it with the desktop client?**
144
+
145
+ There seem to be some articles on the Internet suggesting that this is a good
146
+ idea. It's not. Using the desktop client to sync a bare Git repository is not
147
+ safe. Concurrent changes or delays in syncing can result in a corrupted Git
148
+ repository.
149
+
150
+ **How can I access / recover my repository from Dropbox without using the
151
+ git-remote-dropbox helper?**
152
+
153
+ Because git-remote-dropbox uses an on-disk format that's compatible with Git,
154
+ accessing your repository without using the helper is easy:
155
+
156
+ 1. Download the repository data (a directory containing the `objects` and
157
+ `refs` directories) from Dropbox.
158
+ 2. Make a new directory and initialize an empty Git repository in the
159
+ directory.
160
+ 3. Overwrite `.git/refs` and `.git/objects` in your newly initialized
161
+ repository with the data downloaded from Dropbox (using a command like `rm
162
+ -rf .git/{refs,objects} && cp -r /path/to/data/{refs,objects} .git/`).
163
+ 4. Check out a branch (using a command like `git checkout -f master`).
164
+ 5. Optionally, run `git gc --aggressive` to save disk space in your local
165
+ repository.
166
+
167
+ **How do I use git-remote-dropbox from behind a proxy server?**
168
+
169
+ You can use git-remote-dropbox from behind a proxy server by setting the
170
+ `HTTP_PROXY` and `HTTPS_PROXY` environment variables. See
171
+ [here](http://docs.python-requests.org/en/latest/user/advanced/#proxies) for
172
+ more details.
173
+
174
+ **How do I use git-remote-dropbox with submodules?**
175
+
176
+ You can allow this by setting
177
+ [`protocol.dropbox.allow`](https://git-scm.com/docs/git-config#Documentation/git-config.txt-protocolltnamegtallow)
178
+ to `always`:
179
+
180
+ ```bash
181
+ git config --global --add protocol.dropbox.allow always
182
+ ```
183
+
184
+ ## Design
185
+
186
+ To read about the design of git-remote-dropbox, see [DESIGN.md](DESIGN.md).
187
+ This could be especially useful if you're thinking about contributing to the
188
+ project.
189
+
190
+ ## Contributing
191
+
192
+ Do you have ideas on how to improve git-remote-dropbox? Have a feature request,
193
+ bug report, or patch? Great! See [CONTRIBUTING.md](CONTRIBUTING.md) for
194
+ information on what you can do about that.
195
+
196
+ ## License
197
+
198
+ Copyright (c) Anish Athalye. Released under the MIT License. See
199
+ [LICENSE.md](LICENSE.md) for details.
@@ -1,7 +1,6 @@
1
1
  LICENSE.md
2
2
  README.md
3
3
  pyproject.toml
4
- setup.cfg
5
4
  setup.py
6
5
  git_remote_dropbox/__init__.py
7
6
  git_remote_dropbox/constants.py
@@ -2,4 +2,3 @@
2
2
  git-dropbox = git_remote_dropbox.cli.manage:main
3
3
  git-dropbox-manage = git_remote_dropbox.cli.manage:main
4
4
  git-remote-dropbox = git_remote_dropbox.cli.helper:main
5
-
@@ -1,6 +1,3 @@
1
- [bdist_wheel]
2
- universal = 1
3
-
4
1
  [egg_info]
5
2
  tag_build =
6
3
  tag_date = 0
@@ -50,6 +50,7 @@ setup(
50
50
  packages=find_packages(),
51
51
  install_requires=[
52
52
  "dropbox>=11,<12",
53
+ "setuptools",
53
54
  ],
54
55
  entry_points={
55
56
  "console_scripts": [
@@ -1,187 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: git-remote-dropbox
3
- Version: 2.0.0
4
- Summary: A transparent bidirectional bridge between Git and Dropbox
5
- Home-page: https://github.com/anishathalye/git-remote-dropbox
6
- Author: Anish Athalye
7
- Author-email: me@anishathalye.com
8
- License: MIT
9
- Description: # git-remote-dropbox [![Build Status](https://github.com/anishathalye/git-remote-dropbox/workflows/CI/badge.svg)](https://github.com/anishathalye/git-remote-dropbox/actions?query=workflow%3ACI)
10
-
11
- git-remote-dropbox is a transparent bidirectional bridge between Git and
12
- Dropbox. It lets you use a Dropbox folder or a shared folder as a Git remote!
13
-
14
- ---
15
-
16
- This Git remote helper makes Dropbox act like a _true Git remote_. It maintains
17
- _all guarantees_ that are provided by a traditional Git remote while using
18
- Dropbox as a backing store. This means that it works correctly even when there
19
- are multiple people operating on the repository at once, making it possible to
20
- use a Dropbox shared folder as a Git remote for collaboration.
21
-
22
- Once the helper is installed, using it is as simple as adding a remote like
23
- `dropbox:///path/to/repo`.
24
-
25
- To clone repositories in folders or shared folders mounted in your Dropbox, you
26
- can run:
27
-
28
- ```bash
29
- git clone "dropbox:///path/to/repo"
30
- ```
31
-
32
- To add a remote to an existing local repository, you can run:
33
-
34
- ```bash
35
- git remote add origin "dropbox:///path/to/repo"
36
- ```
37
-
38
- The repository directory will be created automatically the first time you push.
39
-
40
- After adding the remote, you can treat it just like a regular Git remote. The
41
- Dropbox-backed remote supports all operations that regular remotes support, and
42
- it provides identical guarantees in terms of atomicity even when there are
43
- concurrent operations, even when using a shared folder.
44
-
45
- ## Setup
46
-
47
- ### Install git-remote-dropbox
48
-
49
- 1. Prerequisites:
50
- 1. `python` and matching `pip`
51
- 2. `git`
52
- 2. Install this package with `pip install git-remote-dropbox`. Use `which git-remote-dropbox` to make sure it's available via `$PATH`. If not, edit `$PATH` appropriately.
53
-
54
- ### Log in to Dropbox
55
-
56
- Run `git dropbox login` and follow the instructions to authenticate with OAuth
57
- and log in to your Dropbox account.
58
-
59
- ## Sharing
60
-
61
- The above gives you a way to create a Git repository on Dropbox and use it from multiple machines that you own. In other words, it's a convenient way to share a remote with your laptop and your desktop.
62
-
63
- If you want to share with other people, you should explicitly share (e.g. via the Dropbox website) the root folder of the repo with your collaborators. Then they should also install git-remote-dropbox and log in *with their own account*.
64
-
65
- ## Multiple Accounts
66
-
67
- git-remote-dropbox supports using multiple Dropbox accounts. You can have named
68
- accounts with `git dropbox login <username>`. **These usernames are unrelated
69
- to your Dropbox login; you can choose whatever names you want to organize your
70
- accounts, e.g. "work".**
71
-
72
- You can tell git-remote-dropbox to use a particular account by setting the git
73
- remote URL appropriately, specifying a username like:
74
- `dropbox://username@/path/to/repo`.
75
-
76
- ## Repository Manager
77
-
78
- In addition to the git remote helper, git-remote-dropbox comes with an
79
- additional tool to manage your logins and repositories on Dropbox. This tool
80
- can be invoked as `git dropbox`.
81
-
82
- The tool supports the following commands:
83
-
84
- - `git dropbox login [username]`: log in, either with the default account (no
85
- need to specify a username in remote), or with an alias (for multi-account
86
- support)
87
- - `git dropbox logout [username]`: log out
88
- - `git dropbox show-logins`: list logged-in accounts
89
- - `git dropbox set-head <remote> <branch>`: set default branch on the remote
90
- - `git dropbox version`: show version
91
-
92
- ## Notes
93
-
94
- - Do not directly interact with Git repositories in your Dropbox folder -always
95
- use git-remote-dropbox. If you're using the Dropbox client to sync files,
96
- it's a good idea to use [selective
97
- sync](https://help.dropbox.com/installs-integrations/sync-uploads/selective-sync-overview)
98
- and disable syncing of the folder containing the repository to avoid any
99
- unexpected conflicts, just in case.
100
-
101
- - git-remote-dropbox does not use the Dropbox desktop client - it uses the API
102
- directly. It does not require that the desktop client is installed.
103
-
104
- - The remote helper does not support shallow cloning.
105
-
106
- - Cloning a repository or fetching a lot of objects produces lots of loose
107
- objects. To save space in the local repository, run `git gc --aggressive`.
108
-
109
- - If the remote HEAD (default branch on the remote) is not set, after cloning a
110
- repository from Dropbox, Git will not automatically check out a branch. To
111
- check out a branch, run `git checkout <branch>`. To set the default branch on
112
- the remote, use the [`git dropbox`](#repository-manager) command.
113
-
114
- ## FAQ
115
-
116
- **Why shouldn't I keep my Git repository in Dropbox and let the client sync
117
- it?**
118
-
119
- There seem to be a lot of articles on the Internet recommending this as a good
120
- workflow. However, this is *not a good idea*! The desktop client is not aware
121
- of how Git manages it's on-disk format, so if there are concurrent changes or
122
- delays in syncing, it's possible to have conflicts that result in a corrupted
123
- Git repository. This may be uncommon with the way the timing works out in the
124
- single user case, but it's still not safe!
125
-
126
- **Why shouldn't I keep a bare Git repository in a Dropbox shared folder, use it
127
- as a folder-based Git remote, and sync it with the desktop client?**
128
-
129
- There seem to be some articles on the Internet suggesting that this is a good
130
- idea. It's not. Using the desktop client to sync a bare Git repository is not
131
- safe. Concurrent changes or delays in syncing can result in a corrupted Git
132
- repository.
133
-
134
- **How can I access / recover my repository from Dropbox without using the
135
- git-remote-dropbox helper?**
136
-
137
- Because git-remote-dropbox uses an on-disk format that's compatible with Git,
138
- accessing your repository without using the helper is easy:
139
-
140
- 1. Download the repository data (a directory containing the `objects` and
141
- `refs` directories) from Dropbox.
142
- 2. Make a new directory and initialize an empty Git repository in the
143
- directory.
144
- 3. Overwrite `.git/refs` and `.git/objects` in your newly initialized
145
- repository with the data downloaded from Dropbox (using a command like `rm
146
- -rf .git/{refs,objects} && cp -r /path/to/data/{refs,objects} .git/`).
147
- 4. Check out a branch (using a command like `git checkout -f master`).
148
- 5. Optionally, run `git gc --aggressive` to save disk space in your local
149
- repository.
150
-
151
- **How do I use git-remote-dropbox from behind a proxy server?**
152
-
153
- You can use git-remote-dropbox from behind a proxy server by setting the
154
- `HTTP_PROXY` and `HTTPS_PROXY` environment variables. See
155
- [here](http://docs.python-requests.org/en/latest/user/advanced/#proxies) for
156
- more details.
157
-
158
- ## Design
159
-
160
- To read about the design of git-remote-dropbox, see [DESIGN.md](DESIGN.md).
161
- This could be especially useful if you're thinking about contributing to the
162
- project.
163
-
164
- ## Contributing
165
-
166
- Do you have ideas on how to improve git-remote-dropbox? Have a feature request,
167
- bug report, or patch? Great! See [CONTRIBUTING.md](CONTRIBUTING.md) for
168
- information on what you can do about that.
169
-
170
- ## License
171
-
172
- Copyright (c) 2015-2022 Anish Athalye. Released under the MIT License. See
173
- [LICENSE.md](LICENSE.md) for details.
174
-
175
- Keywords: git dropbox
176
- Platform: UNKNOWN
177
- Classifier: Development Status :: 5 - Production/Stable
178
- Classifier: Intended Audience :: Developers
179
- Classifier: Topic :: Software Development :: Version Control
180
- Classifier: License :: OSI Approved :: MIT License
181
- Classifier: Programming Language :: Python :: 3
182
- Classifier: Programming Language :: Python :: 3.6
183
- Classifier: Programming Language :: Python :: 3.7
184
- Classifier: Programming Language :: Python :: 3.8
185
- Classifier: Programming Language :: Python :: 3.9
186
- Classifier: Programming Language :: Python :: 3.10
187
- Description-Content-Type: text/markdown
@@ -1,187 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: git-remote-dropbox
3
- Version: 2.0.0
4
- Summary: A transparent bidirectional bridge between Git and Dropbox
5
- Home-page: https://github.com/anishathalye/git-remote-dropbox
6
- Author: Anish Athalye
7
- Author-email: me@anishathalye.com
8
- License: MIT
9
- Description: # git-remote-dropbox [![Build Status](https://github.com/anishathalye/git-remote-dropbox/workflows/CI/badge.svg)](https://github.com/anishathalye/git-remote-dropbox/actions?query=workflow%3ACI)
10
-
11
- git-remote-dropbox is a transparent bidirectional bridge between Git and
12
- Dropbox. It lets you use a Dropbox folder or a shared folder as a Git remote!
13
-
14
- ---
15
-
16
- This Git remote helper makes Dropbox act like a _true Git remote_. It maintains
17
- _all guarantees_ that are provided by a traditional Git remote while using
18
- Dropbox as a backing store. This means that it works correctly even when there
19
- are multiple people operating on the repository at once, making it possible to
20
- use a Dropbox shared folder as a Git remote for collaboration.
21
-
22
- Once the helper is installed, using it is as simple as adding a remote like
23
- `dropbox:///path/to/repo`.
24
-
25
- To clone repositories in folders or shared folders mounted in your Dropbox, you
26
- can run:
27
-
28
- ```bash
29
- git clone "dropbox:///path/to/repo"
30
- ```
31
-
32
- To add a remote to an existing local repository, you can run:
33
-
34
- ```bash
35
- git remote add origin "dropbox:///path/to/repo"
36
- ```
37
-
38
- The repository directory will be created automatically the first time you push.
39
-
40
- After adding the remote, you can treat it just like a regular Git remote. The
41
- Dropbox-backed remote supports all operations that regular remotes support, and
42
- it provides identical guarantees in terms of atomicity even when there are
43
- concurrent operations, even when using a shared folder.
44
-
45
- ## Setup
46
-
47
- ### Install git-remote-dropbox
48
-
49
- 1. Prerequisites:
50
- 1. `python` and matching `pip`
51
- 2. `git`
52
- 2. Install this package with `pip install git-remote-dropbox`. Use `which git-remote-dropbox` to make sure it's available via `$PATH`. If not, edit `$PATH` appropriately.
53
-
54
- ### Log in to Dropbox
55
-
56
- Run `git dropbox login` and follow the instructions to authenticate with OAuth
57
- and log in to your Dropbox account.
58
-
59
- ## Sharing
60
-
61
- The above gives you a way to create a Git repository on Dropbox and use it from multiple machines that you own. In other words, it's a convenient way to share a remote with your laptop and your desktop.
62
-
63
- If you want to share with other people, you should explicitly share (e.g. via the Dropbox website) the root folder of the repo with your collaborators. Then they should also install git-remote-dropbox and log in *with their own account*.
64
-
65
- ## Multiple Accounts
66
-
67
- git-remote-dropbox supports using multiple Dropbox accounts. You can have named
68
- accounts with `git dropbox login <username>`. **These usernames are unrelated
69
- to your Dropbox login; you can choose whatever names you want to organize your
70
- accounts, e.g. "work".**
71
-
72
- You can tell git-remote-dropbox to use a particular account by setting the git
73
- remote URL appropriately, specifying a username like:
74
- `dropbox://username@/path/to/repo`.
75
-
76
- ## Repository Manager
77
-
78
- In addition to the git remote helper, git-remote-dropbox comes with an
79
- additional tool to manage your logins and repositories on Dropbox. This tool
80
- can be invoked as `git dropbox`.
81
-
82
- The tool supports the following commands:
83
-
84
- - `git dropbox login [username]`: log in, either with the default account (no
85
- need to specify a username in remote), or with an alias (for multi-account
86
- support)
87
- - `git dropbox logout [username]`: log out
88
- - `git dropbox show-logins`: list logged-in accounts
89
- - `git dropbox set-head <remote> <branch>`: set default branch on the remote
90
- - `git dropbox version`: show version
91
-
92
- ## Notes
93
-
94
- - Do not directly interact with Git repositories in your Dropbox folder -always
95
- use git-remote-dropbox. If you're using the Dropbox client to sync files,
96
- it's a good idea to use [selective
97
- sync](https://help.dropbox.com/installs-integrations/sync-uploads/selective-sync-overview)
98
- and disable syncing of the folder containing the repository to avoid any
99
- unexpected conflicts, just in case.
100
-
101
- - git-remote-dropbox does not use the Dropbox desktop client - it uses the API
102
- directly. It does not require that the desktop client is installed.
103
-
104
- - The remote helper does not support shallow cloning.
105
-
106
- - Cloning a repository or fetching a lot of objects produces lots of loose
107
- objects. To save space in the local repository, run `git gc --aggressive`.
108
-
109
- - If the remote HEAD (default branch on the remote) is not set, after cloning a
110
- repository from Dropbox, Git will not automatically check out a branch. To
111
- check out a branch, run `git checkout <branch>`. To set the default branch on
112
- the remote, use the [`git dropbox`](#repository-manager) command.
113
-
114
- ## FAQ
115
-
116
- **Why shouldn't I keep my Git repository in Dropbox and let the client sync
117
- it?**
118
-
119
- There seem to be a lot of articles on the Internet recommending this as a good
120
- workflow. However, this is *not a good idea*! The desktop client is not aware
121
- of how Git manages it's on-disk format, so if there are concurrent changes or
122
- delays in syncing, it's possible to have conflicts that result in a corrupted
123
- Git repository. This may be uncommon with the way the timing works out in the
124
- single user case, but it's still not safe!
125
-
126
- **Why shouldn't I keep a bare Git repository in a Dropbox shared folder, use it
127
- as a folder-based Git remote, and sync it with the desktop client?**
128
-
129
- There seem to be some articles on the Internet suggesting that this is a good
130
- idea. It's not. Using the desktop client to sync a bare Git repository is not
131
- safe. Concurrent changes or delays in syncing can result in a corrupted Git
132
- repository.
133
-
134
- **How can I access / recover my repository from Dropbox without using the
135
- git-remote-dropbox helper?**
136
-
137
- Because git-remote-dropbox uses an on-disk format that's compatible with Git,
138
- accessing your repository without using the helper is easy:
139
-
140
- 1. Download the repository data (a directory containing the `objects` and
141
- `refs` directories) from Dropbox.
142
- 2. Make a new directory and initialize an empty Git repository in the
143
- directory.
144
- 3. Overwrite `.git/refs` and `.git/objects` in your newly initialized
145
- repository with the data downloaded from Dropbox (using a command like `rm
146
- -rf .git/{refs,objects} && cp -r /path/to/data/{refs,objects} .git/`).
147
- 4. Check out a branch (using a command like `git checkout -f master`).
148
- 5. Optionally, run `git gc --aggressive` to save disk space in your local
149
- repository.
150
-
151
- **How do I use git-remote-dropbox from behind a proxy server?**
152
-
153
- You can use git-remote-dropbox from behind a proxy server by setting the
154
- `HTTP_PROXY` and `HTTPS_PROXY` environment variables. See
155
- [here](http://docs.python-requests.org/en/latest/user/advanced/#proxies) for
156
- more details.
157
-
158
- ## Design
159
-
160
- To read about the design of git-remote-dropbox, see [DESIGN.md](DESIGN.md).
161
- This could be especially useful if you're thinking about contributing to the
162
- project.
163
-
164
- ## Contributing
165
-
166
- Do you have ideas on how to improve git-remote-dropbox? Have a feature request,
167
- bug report, or patch? Great! See [CONTRIBUTING.md](CONTRIBUTING.md) for
168
- information on what you can do about that.
169
-
170
- ## License
171
-
172
- Copyright (c) 2015-2022 Anish Athalye. Released under the MIT License. See
173
- [LICENSE.md](LICENSE.md) for details.
174
-
175
- Keywords: git dropbox
176
- Platform: UNKNOWN
177
- Classifier: Development Status :: 5 - Production/Stable
178
- Classifier: Intended Audience :: Developers
179
- Classifier: Topic :: Software Development :: Version Control
180
- Classifier: License :: OSI Approved :: MIT License
181
- Classifier: Programming Language :: Python :: 3
182
- Classifier: Programming Language :: Python :: 3.6
183
- Classifier: Programming Language :: Python :: 3.7
184
- Classifier: Programming Language :: Python :: 3.8
185
- Classifier: Programming Language :: Python :: 3.9
186
- Classifier: Programming Language :: Python :: 3.10
187
- Description-Content-Type: text/markdown