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

Range operator for Filter #939

Merged
merged 1 commit into from
Jan 27, 2017
Merged

Range operator for Filter #939

merged 1 commit into from
Jan 27, 2017

Conversation

schdub
Copy link
Contributor

@schdub schdub commented Jan 24, 2017

Support of operator 'BETWEEN'. For example for column with filter '400~500' will be generated WHERE statement 'BETWEEN 400 AND 500'.

Example of wrong filters:

500~400
a~b
1~a

#935

@justinclift
Copy link
Member

Awesome @schdub. 😁

@MKleusberg You ok to review?

@schdub
Copy link
Contributor Author

schdub commented Jan 24, 2017

@justinclift, not sure why its so much commits in PR. How to remove merge commits?

@justinclift
Copy link
Member

@schdub This should work. I think. 😄

$ git reset f728ff73ab18fe038c457fa2fb392fdd892dc808
$ git add src/sqlitetablemodel.cpp
$ git commit
$ git push [repo] [branch]

@justinclift
Copy link
Member

justinclift commented Jan 24, 2017

Either way, not to worry. We can squash the commits into a single one when we merge it. 😄

@justinclift
Copy link
Member

@schdub With that last commit (FIX: Endless loop ...), that's for #941 isn't it?

If so, would you be ok to put that into a separate PR? It helps to keep track of things when we're writing up release notes. 😀

@schdub
Copy link
Contributor Author

schdub commented Jan 25, 2017

@justinclift I thought to do so, but it didnt happened. How am I going to create a second PR?
New commit is adding to already existing one.

@justinclift
Copy link
Member

justinclift commented Jan 25, 2017

The way I personally do things, is to keep my master branch in sync with the sqlitebrowser/sqlitebrowser master branch. Then, when I want to create a PR I make a new branch from that and do the commits there.

Your repo seems a bit messy 😁, so lets try a different approach. First, create a totally new branch, then we can get it in sync with the upstream (sqlitebrowser) master branch. After that, add your patch to it then push it to a new PR.

So:

  1. Make a new branch

    $ git checkout -b temp_master
    
  2. Get it into sync with sqlitebrowser master branch

    $ git reset --hard 31f73df721df0d79997fe1b7127c92cda2fcfd7a
    $ git clean -dffx
    $ git pull https://github.com/sqlitebrowser/sqlitebrowser master
    

Note - This is a cheating approach, but it works 😁

  1. Add your patch on top

    $ git cherry-pick 47321bc4eb867f350a374b5735ce0ed520288dac
    
  2. Push this new branch to GitHub, so you can make a PR from it

    $ git push https://github.com/schdub/sqlitebrowser.git temp_master:temp_master
    

In theory, number 4 should create a new "temp_master" branch in your repo on GitHub, with just that single commit added on top of the main "master" branch. If that works, then you should be able to create a new PR from it.

Once that's done, I can show you how to rewind your PR here (#939) so it doesn't include that last commit. 😄

@justinclift
Copy link
Member

Heh Heh Heh, just noticed you have figured it out already.

So, the way to remove the last commit in this PR is:

$ git checkout master    ← "master" here, because that is the branch name you used for this PR
$ git reset --hard HEAD^     ←  "HEAD^" means "latest commit - 1"
$ git push --force https://github.com/schdub/sqlitebrowser.git master   ←  The "--force" bit is needed, to move the index back one

In theory 😄, that should work.

@schdub
Copy link
Contributor Author

schdub commented Jan 25, 2017

@justinclift added to bookmarks. Thank you so much.

@justinclift
Copy link
Member

You're welcome. 😄

@MKleusberg
Copy link
Member

Thanks @schdub! 😃 Looks like you have put a lot of thought into this already. I'll have a closer look tomorrow or the day after tomorrow but I don't expect to find any problems 😃

@MKleusberg
Copy link
Member

Looks good! Thank you for adding this :D

@MKleusberg MKleusberg merged commit a75f2da into sqlitebrowser:master Jan 27, 2017
@justinclift justinclift added the enhancement Feature requests. label Jan 27, 2017
@MKleusberg MKleusberg mentioned this pull request Jan 27, 2017
11 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Feature requests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants