I find your lack of git disturbing

tdietrichtdietrich Posts: 12
Pardon the StarWars reference.

Your implementation of git integration in this product is somewhat flawed.

First item:
When committing changes, you run the command "git checkout -q {filename}".

Checkout in git is not the same thing as checkout in SVN. With git, the checkout command is for switching branches. Since there isn't a branch with the same name as the file you are trying to commit, this command does nothing, but since you've applied the -q argument, the error message is suppressed. There is no need to perform this command at all, just remove it. It's dangerous to have it there- if there happens to be a branch with the same name as the file that an edit is being performed on (not likely, I'll grant), this would switch branches on commit and could muck up someone's project.


Second Item:
I would also like to see a "Apply" command that would just update the script files in the linked project without calling a commit. If I want to make changes to a table's structure, I'll also need to make changes to my ORM mappings, and the table changes and orm mapping changes should be committed together- but I have no way of just sending those changes to my project without also calling a commit. Perhaps the proper method is to make the changes in the SQL Connect tool in visual studio. The problem is that there are some features that SQL connect doesn't support that SQL source control does- ie: static data, so it's not a complete solution for that.

Any thoughts?

Comments

  • Hi,

    First item:
    Correct, this was a bug, thanks. Our command line for revert wasn't quite right either. I've fixed the git file and it'll be in the next release. In the mean time, these files are stored in %localappdata%\Red Gate\SQL Source Control 3\CommandLineHooks - feel free to edit yours to be how you want it.

    Second item:
    This is a really good point. I can't speak for SQL Connect's roadmap, but you're right that it's a new product and doesn't have those features yet. This question comes up a lot with people wanting to commit application and database changes together. We'll look into the Apply button. For now, I can think of two options for you:
    1) Use Source Control to commit you database changes. Then commit your ORM changes. Then use git rebase's to squash command to merge the two commits into one (before you push). See `git help rebase`.
    2) Edit git.xml in the location I posted above. in the Commit element, just remove the call to `git commit`. Even if the <CommandLine> tag is empty, Source Control will still write your changes to the working folder when you press Commit. You can then add and commit manually.

    Hope this helps,
    Matt Turner,
    Software Engineer,
    SQL Source Control
    Matt Turner
    Project Manager
    SQL Source Control
  • Good information, thanks! Looking forward to seeing this fixed and maybe seeing Git become more of a first party to the tool.
Sign In or Register to comment.