[PATCH] dim: allow to add link to the current HEAD

Vivi, Rodrigo rodrigo.vivi at intel.com
Mon Nov 18 20:16:19 UTC 2019



On Nov 18, 2019, at 12:14 PM, Lucas De Marchi <lucas.demarchi at intel.com<mailto:lucas.demarchi at intel.com>> wrote:

On Mon, Nov 18, 2019 at 04:57:34PM +0200, Jani Nikula wrote:
On Fri, 15 Nov 2019, Lucas De Marchi <lucas.demarchi at intel.com<mailto:lucas.demarchi at intel.com>> wrote:
Add method add-link-head that applies the link to head without any
additional check. This is useful either to reduce typing or to add a
link while in the middle of an interactive rebase.

I see the patch does what it says on the box. However:

1) Most commands expect you to supply the branch name so you know what
 you're doing. There's tab completion to aid you, but you need to see
 what branch you're operating on. This has been in place since there
 was only one gun and two feet; now there are quite a few more people
 with opportunities to shoot themselves in the foot.

2) I think we should discourage pushing locally rebased
 patches. Recommend only pushing patches that apply cleanly. I'd go as
 far as removing the add-link* subcommands altogether.

Not sure how this is helping or avoiding that. "push" was never
mentioned here and it's not what this is about.

This was useful for me while rebasing a "feature branch"
to prep a new revision.  It's useful for the future developer reading
the patch to have a link to the revision where the patch was discussed,
rather than a link to a last revision where all the reviews were already
collected.


Very good point. But we need to do in a way that we don't loose the
last link. The last one is the proof that it passed CI.


Also any patch being applied to any branch are in other words being
rebased since your branch probably changed from the time you wrote it
and the time it was applied, even if it applies cleanly (your rebase
might have being clean, too).

Lucas De Marchi



BR,
Jani.




Signed-off-by: Lucas De Marchi <lucas.demarchi at intel.com<mailto:lucas.demarchi at intel.com>>
---
dim | 23 +++++++++++++++--------
1 file changed, 15 insertions(+), 8 deletions(-)

diff --git a/dim b/dim
index 1c2da80..3aad25f 100755
--- a/dim
+++ b/dim
@@ -1255,17 +1255,11 @@ function dim_rebase
fi
}

-function dim_add_link
+function dim_add_link_head
{
- local branch file message_id
+ local file message_id

- branch=${1:?$usage}
- shift
file=$(mktemp)
-
- assert_branch $branch
- assert_repo_clean
-
cat > $file

message_id=$(message_get_id $file)
@@ -1279,6 +1273,19 @@ function dim_add_link
fi
}

+function dim_add_link
+{
+ local branch file message_id
+
+ branch=${1:?$usage}
+ shift
+
+ assert_branch $branch
+ assert_repo_clean
+
+ dim_add_link_head
+}
+
function dim_add_link_queued
{
dim_add_link drm-intel-next-queued "$@"

--
Jani Nikula, Intel Open Source Graphics Center
_______________________________________________
dim-tools mailing list
dim-tools at lists.freedesktop.org<mailto:dim-tools at lists.freedesktop.org>
https://lists.freedesktop.org/mailman/listinfo/dim-tools

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/dim-tools/attachments/20191118/73316030/attachment-0001.html>


More information about the dim-tools mailing list