173
174
repo_init_revisions(the_repository, &revs, prefix);
175
176
- revs.verbose_header = 1;
177
- revs.max_parents = 1;
178
- revs.cherry_mark = 1;
179
- revs.limited = 1;
176
+ strvec_pushl(&rev_walk_args, "", argv[2], "--not", argv[1], NULL);
177
+
178
+ /*
179
+ * Set desired values for rev walking options here. If they
180
+ * are changed by some user specified option in setup_revisions()
181
+ * below, we will detect that below and then warn.
182
+ *
183
+ * TODO: In the future we might want to either die(), or allow
184
+ * some options changing these values if we think they could
185
+ * be useful.
186
+ */
187
revs.reverse = 1;
181
- revs.right_only = 1;
188
revs.sort_order = REV_SORT_IN_GRAPH_ORDER;
189
revs.topo_order = 1;
184
-
185
- strvec_pushl(&rev_walk_args, "", argv[2], "--not", argv[1], NULL);
190
+ revs.simplify_history = 0;
191
192
if (setup_revisions(rev_walk_args.nr, rev_walk_args.v, &revs, NULL) > 1) {
193
ret = error(_("unhandled options"));
194
goto cleanup;
195
}
196
197
+ /*
198
+ * Detect and warn if we override some user specified rev
199
+ * walking options.
200
+ */
201
+ if (revs.reverse != 1) {
202
+ warning(_("some rev walking options will be overridden as "
203
+ "'%s' bit in 'struct rev_info' will be forced"),
204
+ "reverse");
205
+ revs.reverse = 1;
206
+ }
207
+ if (revs.sort_order != REV_SORT_IN_GRAPH_ORDER) {
208
+ warning(_("some rev walking options will be overridden as "
209
+ "'%s' bit in 'struct rev_info' will be forced"),
210
+ "sort_order");
211
+ revs.sort_order = REV_SORT_IN_GRAPH_ORDER;
212
+ }
213
+ if (revs.topo_order != 1) {
214
+ warning(_("some rev walking options will be overridden as "
215
+ "'%s' bit in 'struct rev_info' will be forced"),
216
+ "topo_order");
217
+ revs.topo_order = 1;
218
+ }
219
+ if (revs.simplify_history != 0) {
220
+ warning(_("some rev walking options will be overridden as "
221
+ "'%s' bit in 'struct rev_info' will be forced"),
222
+ "simplify_history");
223
+ revs.simplify_history = 0;
224
+ }
225
+
226
strvec_clear(&rev_walk_args);
227
228
if (prepare_revision_walk(&revs) < 0) {