Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Committed patches should be removed from plaid #69

Open
ftomassetti opened this issue Oct 20, 2015 · 7 comments
Open

Committed patches should be removed from plaid #69

ftomassetti opened this issue Oct 20, 2015 · 7 comments

Comments

@ftomassetti
Copy link
Collaborator

We have figure out how to determine if a patch has been committed.

  • Do we want to use a git hook?
  • What to do about mercurial?
  • Can be the patchwork script imported?
@lu-zero
Copy link
Owner

lu-zero commented Oct 20, 2015

The patchwork script requires to run on a tree and it is just working on patches (scm-agnostic), but has an high ratio of false-negatives so would be good to look at it and see why.

The way it works require to support some kind of rpc, an initial version can just share the plaid configuration, use a local tree and directly use the database.

Makes also easier to check if a patch applies.

@ftomassetti
Copy link
Collaborator Author

rpc?

@lu-zero
Copy link
Owner

lu-zero commented Oct 22, 2015

xml-rpc to be specific. I won't mimic it.

@ftomassetti
Copy link
Collaborator Author

Does this make sense?
http://git.661346.n2.nabble.com/Figuring-out-which-patches-have-been-applied-td3755727.html

#!/bin/bash 

set -o pipefail 
searchCommitID=`git rev-parse $1` 
searchPatchID=`git show $searchCommitID | git patch-id` 
if [ $? -ne 0 ]; then 
        exit 1 
fi 
searchPatchID=${searchPatchID% *} 

echo "Searching for equivalents to commit $searchCommitID (patch 
$searchPatchID)..." 
git log --all -p | git patch-id | grep $searchPatchID | 
while read patchID commitID; do 
        if [ "$commitID" = "$searchCommitID" ]; then 
                echo "Exact commit $commitID is on the following branches:" 
        else 
                echo "Equivalent commit $commitID is on the following branches:" 
        fi 
        git branch -a --contains $commitID 
done

@ftomassetti
Copy link
Collaborator Author

Perhaps we could use the date: we look at the files involved and their history. If we find a commit by the same author at the same time it means the patch was committed

@lu-zero
Copy link
Owner

lu-zero commented Oct 23, 2015

DESCRIPTION
       A "patch ID" is nothing but a sum of SHA-1 of the file diffs associated with a patch, with whitespace and line numbers
       ignored. As such, it's "reasonably stable", but at the same time also reasonably unique, i.e., two patches that have the
       same "patch ID" are almost guaranteed to be the same thing.

This help if the only change in the commit patch is in the message. If we want to go this route we should keep a list of sha1 per-hunk and use it to decide if a patch is an update or not.

All depends on the control of the users and if for minor changes (e.g. bumping the version file when rebasing a set over another just merged) it is worthy to spam the mailing list or not.

Are you willing to play with the concept I'd make it a stand-alone library.

For now probably it is a good initial approximation using the patch-id.

@lu-zero
Copy link
Owner

lu-zero commented Oct 23, 2015

I guess we can use any of those heuristic, implement one see how many false positives we can get and the how many false negatives and let the user improve it.

If we manage to make a better job in figuring out what is an update to what probably the patch ID approach would be enough.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants