[PATCH] dim: Check that patches have git-format-patch default prefixes

2021-11-29 Thread Javier Martinez Canillas
By default the git-format-patch command generates patches with prefixes
for the source and destination (-p1) and is also what git-am uses as a
default. The command strips the first leading path component when patch
is applied (unless a different -p argument is used).

But the patch generating behaviour can be changed with git-format-patch
--no-prefix argument (or setting 'diff.noprefix = true' in .gitconfig).

Patches with no source and destination prefixes will confuse the git-am
3-way merge logic, since stripping the first path component will lead
to wrong paths for newly added files.

To avoid this, check that patches to apply are using git-format-patch's
defaults prefixes to make sure that git-am defaults are safe to use too.

Signed-off-by: Javier Martinez Canillas 
---

 dim | 19 +++
 1 file changed, 19 insertions(+)

diff --git a/dim b/dim
index bbe9308ac695..1a07cc177fb5 100755
--- a/dim
+++ b/dim
@@ -1113,6 +1113,18 @@ function check_merge_baseline
fi
 }
 
+# ensure the patch has prefixes (-p1), since otherwise it can confuse the git 
am
+# 3-way merge logic. check the default source (a/) and destination (b/) 
prefixes.
+function check_diff_prefix
+{
+   local rv
+   patch="$1"
+
+   rv=$(grep -q -E "^diff --git a\/.+ b\/.+$" $patch)
+
+   return $rv
+}
+
 # ensure we're on branch $1, and apply patches. the rest of the arguments are
 # passed to git am.
 dim_alias_ab=apply-branch
@@ -1139,6 +1151,13 @@ function dim_apply_branch
git mailsplit -b -o$dir $file > /dev/null
 
for patch in "$dir"/*; do
+
+   if ! check_diff_prefix "$patch"; then
+   echoerr "ERROR: The patch does not contain prefixes in 
its diff."
+   echoerr "ERROR: This format can confuse git am when 
applying it."
+   exit 1
+   fi
+
if ! apply_patch $patch "$@"; then
rv=1
fi
-- 
2.33.1



[PULL] drm-misc-next

2021-11-29 Thread Thomas Zimmermann
Hi Dave and Daniel,

here's the second PR for drm-misc-next for what will become Linux 5.17.
It's a bit late, as I was on vacation last week. The most significant
change moves the nomodeset parameter entirely into the DRM subsystem.

Best regards
Thomas

drm-misc-next-2021-11-29:
drm-misc-next for 5.17:

UAPI Changes:

Cross-subsystem Changes:

 * Move 'nomodeset' kernel boot option into DRM subsystem

Core Changes:

 * Replace several DRM_*() logging macros with drm_*() equivalents
 * panel: Add quirk for Lenovo Yoga Book X91F/L
 * ttm: Documentation fixes

Driver Changes:

 * Cleanup nomodeset handling in drivers
 * Fixes
 * bridge/anx7625: Fix reading EDID; Fix error code
 * bridge/megachips: Probe both bridges before registering
 * vboxvideo: Fix ERR_PTR usage
The following changes since commit a713ca234ea9d946235ac7248995c5fddfd9e523:

  Merge drm/drm-next into drm-misc-next (2021-11-18 09:36:39 +0100)

are available in the Git repository at:

  git://anongit.freedesktop.org/drm/drm-misc tags/drm-misc-next-2021-11-29

for you to fetch changes up to 69d846126e1653ca9043c3766c66684132586941:

  drm: Fix build error caused by missing drm_nomodeset.o (2021-11-27 21:05:58 
+0100)


drm-misc-next for 5.17:

UAPI Changes:

Cross-subsystem Changes:

 * Move 'nomodeset' kernel boot option into DRM subsystem

Core Changes:

 * Replace several DRM_*() logging macros with drm_*() equivalents
 * panel: Add quirk for Lenovo Yoga Book X91F/L
 * ttm: Documentation fixes

Driver Changes:

 * Cleanup nomodeset handling in drivers
 * Fixes
 * bridge/anx7625: Fix reading EDID; Fix error code
 * bridge/megachips: Probe both bridges before registering
 * vboxvideo: Fix ERR_PTR usage


Christian König (1):
  drm/amdgpu: partially revert "svm bo enable_signal call condition"

Claudio Suarez (1):
  drm: get rid of DRM_DEBUG_* log calls in drm core, files drm_a*.c

Dan Carpenter (2):
  drm/vboxvideo: fix a NULL vs IS_ERR() check
  drm/bridge: anx7625: fix an error code in anx7625_register_audio()

Hans de Goede (1):
  drm: panel-orientation-quirks: Add quirk for the Lenovo Yoga Book X91F/L

Hsin-Yi Wang (1):
  drm/bridge: anx7625: Fix edid_read break case in sp_tx_edid_read()

Javier Martinez Canillas (7):
  drm: Don't print messages if drivers are disabled due nomodeset
  drm/vboxvideo: Drop CONFIG_VGA_CONSOLE guard to call vgacon_text_force()
  drm: Move nomodeset kernel parameter to the DRM subsystem
  drm: Decouple nomodeset from CONFIG_VGA_CONSOLE
  Documentation/admin-guide: Document nomodeset kernel parameter
  drm: Make the nomodeset message less sensational
  drm: Fix build error caused by missing drm_nomodeset.o

Martyn Welch (1):
  drm/bridge: megachips: Ensure both bridges are probed before registration

Randy Dunlap (1):
  drm: ttm: correct ttm_range_manager kernel-doc notation

 Documentation/admin-guide/kernel-parameters.txt|   7 +
 drivers/gpu/drm/Kconfig|   6 +
 drivers/gpu/drm/Makefile   |   2 +
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c|   5 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c|   9 -
 drivers/gpu/drm/ast/ast_drv.c  |   3 +-
 drivers/gpu/drm/bridge/analogix/anx7625.c  |   6 +-
 .../drm/bridge/megachips-stdp-ge-b850v3-fw.c   |  40 +++-
 drivers/gpu/drm/drm_atomic.c   | 180 ---
 drivers/gpu/drm/drm_atomic_helper.c| 243 -
 drivers/gpu/drm/drm_atomic_uapi.c  |   2 +-
 drivers/gpu/drm/drm_auth.c |  12 +-
 drivers/gpu/drm/drm_nomodeset.c|  24 ++
 drivers/gpu/drm/drm_panel_orientation_quirks.c |   6 +
 drivers/gpu/drm/i915/i915_module.c |   4 +-
 drivers/gpu/drm/mgag200/mgag200_drv.c  |   3 +-
 drivers/gpu/drm/nouveau/nouveau_drm.c  |   4 +-
 drivers/gpu/drm/qxl/qxl_drv.c  |   3 +-
 drivers/gpu/drm/radeon/radeon_drv.c|   9 +-
 drivers/gpu/drm/tiny/bochs.c   |   3 +-
 drivers/gpu/drm/tiny/cirrus.c  |   4 +-
 drivers/gpu/drm/ttm/ttm_range_manager.c|  11 +-
 drivers/gpu/drm/vboxvideo/vbox_drv.c   |   5 +-
 drivers/gpu/drm/vboxvideo/vbox_main.c  |   4 +-
 drivers/gpu/drm/virtio/virtgpu_drv.c   |   3 +-
 drivers/gpu/drm/vmwgfx/vmwgfx_drv.c|   3 +-
 drivers/video/console/vgacon.c |  21 --
 include/drm/drm_drv.h  |   1 +
 include/linux/console.h|   6 -
 29 files changed, 344 insertions(+), 285 deletions(-)
 create mode 100644 drivers/gpu/drm/drm_nomodeset.c

--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH