summaryrefslogtreecommitdiff
path: root/libgphoto2_port/gphoto-m4/README.md
blob: b756b23fd8497ada532155473eb3337c9a9ad1cc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
gphoto-m4
=========

`gphoto-m4` is the gPhoto projects' collection of m4 macros for use
with the autoconf/automake based build systems.

It has been designed to be used in

  * `gphoto2`
  * `libgphoto2`
  * `libgphoto2_port` (located in `libgphoto2/`)
  * `gtkam`

Some macros are re-used ones from `libexif`.

Since the gPhoto project moved from SVN to git, we have not figured
out yet how to properly include the `gphoto-m4` files into the
respective software's `gphoto-m4/` subdirectory (either `git subtree`
or `git submodule` come to mind).

So for the time being, we manually update and synchronize the files.


Use of `gphoto-m4` after the switch to git from SVN
---------------------------------------------------

Since the gPhoto project moved from SVN to git, we have not figured
out yet how to properly include the `gphoto-m4` files into the
respective software's `gphoto-m4/` subdirectory. The options are:

  1. Manually update (and hopefully synchronize) the files.

     Advantages:

       * No special commands needed for users or developers.

     Disadvantages:

       * The manual work for the maintainers is exhausting and error
         prone.

  2. Use `git submodule`.

     Advantages:

       * Defined mechanism for syncing and updating the `gphoto-m4/*`
         files.

     Disadvantages:

       * Requires special git commands from everybody (users,
         developers, and maintainers) all the time (e.g. `git clone
         --recursive` instead of `git clone`).

         This is the showstopper for `git submodule`.

  3. Use `git subtree`.

     Advantages:

       * Defined mechanism for syncing and updating the `gphoto-m4/*`
         files.

       * Requires no special git commands from users or developers.

       * Not even people actually messing with the files in
         `gphoto-m4/*` strictly need special commands.

         Only the maintainers who do the syncing and updating of the
		 `gphoto-m4/*` files need the special commands.

     Disadvantages:

       * Requires special knowledge of special commands instead of
         just copying files around. The concept is less complex than
         copying files round, but it does require special commands.

       * No rebasing possible across pulls to `gphoto-m4/`. Not really
         necessary anyway, though.

       * Pushes of changes to from, say, `gphoto2/gphoto-m4` to
         upstream `gphoto-m4` create a lot of commit history noise in
         the `gphoto-m4` repository by including the complete history
         of the `gphoto2` repository.

         Note this cannot be avoided by using `git subtree split`:
         That is executed internally by `git subtree push`.

         So it appears that using `git subtree push` will push all
         projects' commit history into the `gphoto-m4` repo.

         That is if not a showstopper, then at least very ugly.

For the time being, we manually update and synchronize the files.


Manually syncing and updating files
-----------------------------------

This section has not been written yet.


Using `git submodule`
---------------------

This section has not been written yet.


Using `git subtree`
-------------------


### Using `gphoto-m4` as git subtree ###

This section describes how to use `gphoto-m4` when it has been set up
as a `git subtree` (e.g. in `gphoto2` and `libgphoto2`).

Add a remote for `gphoto-m4`:

    git remote add origin-gphoto-m4 git@github.com:gphoto/gphoto-m4.git

Pull changes to origin-gphoto-m4 into local `gphoto-m4`:

    git subtree pull --prefix gphoto-m4 origin-gphoto-m4 master --squash

Now we can push local changes to 'gphoto-m4/*' back to
`origin-gphoto-m4` as follows:

    git subtree push --prefix gphoto-m4 origin-gphoto-m4 master

FIXME: Add more typical uses cases.


### Setting up `gphoto-m4` as git subtree ###

This section describes how we initially set up `gphoto-m4` as a git
subtree for `gphoto2`. This is only required once by one person, then
never needs to be done by anybody else ever again.

    git subtree add --prefix gphoto-m4 origin-gphoto-m4 master --squash