summaryrefslogtreecommitdiffstats
path: root/dive.h
diff options
context:
space:
mode:
authorGravatar Linus Torvalds <torvalds@linux-foundation.org>2014-03-13 15:42:45 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-03-13 20:48:31 -0700
commit3fe0019bc2939aea4e89cbb8bc5aeb5edeb456d9 (patch)
treecbd3b2b6fa7f2b31977256f1e909920ebe916840 /dive.h
parent0b114a198eb3a648c507bc801a0343bf04dc0191 (diff)
downloadsubsurface-3fe0019bc2939aea4e89cbb8bc5aeb5edeb456d9.tar.gz
git object format: make sure parenthood isn't lost when saving
This makes subsurface remember the git source commit of the dive data. If you save to an existing branch, subsurface will now complain and refuse to save if you try to save if the existing branch is not related to the original source. That would destroy the history of the dive data, which in turn would make it impossible to do sane merging of the data. If you save to a new branch, it will see if the previous parent commit is known in the repository you are saving to, and will save parenthood information if so. Otherwise it will save it as a new parentless commit ("root commit" in git parlance). Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'dive.h')
-rw-r--r--dive.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/dive.h b/dive.h
index 5ac43f16d..41b467d29 100644
--- a/dive.h
+++ b/dive.h
@@ -686,10 +686,14 @@ extern void save_dives_logic(const char *filename, bool select_only);
extern void save_dive(FILE *f, struct dive *dive);
extern void export_dives_uddf(const char *filename, const bool selected);
+struct git_oid;
struct git_repository;
extern struct git_repository *is_git_repository(const char *filename, const char **branchp);
extern int git_save_dives(struct git_repository *, const char *, bool select_only);
extern int git_load_dives(struct git_repository *, const char *);
+extern const char *saved_git_id;
+extern void clear_git_id(void);
+extern void set_git_id(const struct git_oid *);
extern int subsurface_rename(const char *path, const char *newpath);
extern int subsurface_open(const char *path, int oflags, mode_t mode);