[libcamera-devel] [PATCH v4.1 3/3] libcamera: Prevent merge conflicts

Kieran Bingham kieran.bingham at ideasonboard.com
Wed Apr 1 11:15:53 CEST 2020


Merge conflicts are a terrible effect of rebasing code, and they impede
the development process.

Provide a useful helper header to ensure that merge-conflicts are no
longer an issue, and make sure that both sides of the conflict are
compile tested on average at least every other compile cycle. Based on
reliable advice from [0].

 [0] https://twitter.com/erdgeist/status/1197283439000637441

Signed-off-by: Kieran Bingham <kieran.bingham at ideasonboard.com>
---
 src/libcamera/include/merge_conflicts.h | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)
 create mode 100644 src/libcamera/include/merge_conflicts.h

diff --git a/src/libcamera/include/merge_conflicts.h b/src/libcamera/include/merge_conflicts.h
new file mode 100644
index 000000000000..6e5b69a78c7a
--- /dev/null
+++ b/src/libcamera/include/merge_conflicts.h
@@ -0,0 +1,23 @@
+/* SPDX-License-Identifier: LGPL-2.1-or-later */
+/*
+ * Copyright (C) 2020, Kieran Bingham
+ *
+ * merge_conflicts.h - Automatic merge conflict resolution
+ */
+
+#ifndef __LIBCAMERA_MERGE_CONFLICT_H__
+#define __LIBCAMERA_MERGE_CONFLICT_H__
+
+namespace libcamera {
+
+#ifndef __DOXYGEN__
+
+#define <<<<<<<< #if RANDOM % 2
+#define ======== #else
+#define >>>>>>>> #endif
+
+#endif
+
+} /* namespace libcamera */
+
+#endif /* __LIBCAMERA_MERGE_CONFLICT_H__ */
-- 
2.20.1



More information about the libcamera-devel mailing list