quinta-feira, 24 de janeiro de 2013

GIT Merge conflict solving with kdiff3


First we will create a test repository and a test file on which we will create a merge conflict later on.
(in this example, the commands are executed with PowerShell in Windows, but the GIT commands are exactly the same on any other shell or OS)
  • Creation of test repository
    > cd \tempmd mergetestcd mergetest
    > git init
  • Creation of test file
    > 'Original line' | Out-File file.txt
  • Commit into repository
    > git add file.txt
    > git commit -m "Original checkin"
  • Current repository state: (using the tool GIT Extensions)
Now we will create a new branch A, and update the file.
  • Create new branch
    > git branch branch-A
    > git checkout branch-A
  • Update file
    > 'Branch A line' | Out-File file.txt
  • Commit into repository
    > git add file.txt
    > git commit -m "Branch A change"
  • Current repository state:
Now we will create a new branch B, and update the file with a conflicting change.
  • Create new branch, starting from the original master branch
    > git checkout master
    > git branch branch-B
    > git checkout branch-B
  • Update file
    > 'Branch B line' | Out-File file.txt
  • Commit into repository
    > git add file.txt
    > git commit -m "Branch B change"
  • Current repository state:
All this was a preparation for what we will do now: merge the conflicting change of branch-B into branch-A.
  • Select the target branch (in this case branch A)
    > git checkout branch-A
  • Merge the source branch (in this case branch B)
    > git merge branch-B
  • This results in a merge conflict:
    Auto-merging file.txt
    CONFLICT (content): Merge conflict in file.txt
    Automatic merge failed; fix conflicts and then commit the result.
  • This conflict can be resolved by starting your mergetool
    > git mergetool
  • It gives you a message before it launches your mergetool (in my case kdiff3):
    Merging:
    file.txt

    Normal merge conflict for 'file.txt':
      {local}: modified file
      {remote}: modified file
    Hit return to start merge resolution tool (kdiff3):
  • You get a window containing 4 versions of the same file:
    • Top left: "Base".  This is the original version of the file, the last shared version between what became later branch-A and branch-B.
    • Top Middle: "Local". This is the target branch version of the file.  It is called "Local", because this is the currently selected branch (using the last git checkout command).
    • Top Right: "Remote". This is the source branch version of the file. It is called "Remote", as apposed to "Local".
    • Bottom: "Output". This is the merged version of the file. After successful completion of the merge, this will become the new version of the target branch.  In this pane, you can edit the text, or you can right click on any merged part and select what version(s) of the original file you want to include in the output.  In this case, I decide to include the changes done in both branch-A and branch-B.

    • Close the kdiff3 application (saving the file), and commit the merge:
      > git commit
      (accept the default commit message)
    • This brings us to the following repository state:
    • We can check if the content of the test-file is what we need:
      > Get-Content file.txt
      Branch A line
      Branch B line
       

    quinta-feira, 17 de janeiro de 2013

    FxGqlC: Added aggregation functions ENLIST and ENLISTDISTINCT



    Added aggregation functions ENLIST and ENLISTDISTINCT.
    ENLIST creates a string value containing the list of all string values in their original order.
    ENLISTDISTINCT creates a similar list, but the dupplicate values are removed, and the list is ordered. 

    SELECT [Winner], COUNT(*), ENLIST([Tournament])
       FROM ['SampleFiles/Tennis-ATP-2011.csv' -Heading=On]
       GROUP BY [Winner] ORDER BY 2 DESC

    SELECT [Winner], COUNT(*), ENLISTDISTINCT([Tournament])
       FROM ['SampleFiles/Tennis-ATP-2011.csv' -Heading=On]
       GROUP BY [Winner] ORDER BY 2 DESC


    This feature is added to FxGqlC in v2.5-alpha5.

    FxGqlC: Added new function 'PREFIX'

    Added (non-aggregation) text function PREFIX to return the common prefix of two strings.
    An aggregation function PREFIX (with 1 argument) was already added in v2.4.

    SELECT PREFIX('0032478123456', '0032478654321')  
    -- returns '0032478'

    This feature is added to FxGqlC in v2.5-alpha5.




    quinta-feira, 10 de janeiro de 2013

    Advanced Power Searching with Google -- Registration Opens Today



    Cross-posted at Inside Search Blog

    What historic cafe inspired a poem by a Nobel Laureate? In the last three barista world championships, which winners did not use beans from their home country? If you were preparing a blog post on “Curious Trivia of Coffee Culture,” how would you find the answers to these questions? What else would you discover? Now you can sign up for our Advanced Power Searching with Google online course and find out.

    Building on Power Searching with Google, Advanced Power Searching with Google helps you gain a deeper understanding of how to become a better researcher. You will solve complex search challenges similar to those I pose in my blog, or a Google a Day, and explore Google’s advanced search tools not covered in the first class.

    Oftentimes the most intriguing questions invite you to explore beyond the initial answer, and there’s no single correct path to get there. When looking for questions that can’t be solved with a single query, “search” can quickly turn into “research.” Google Search offers a palette of tools to help you dive deeper into the web of knowledge.

    Visit www.powersearchingwithgoogle.com to learn more about our online search courses, and review our search tips on the Power Searching with Google Quick Reference Guide. Advanced Power Searching begins on January 23 and ends on February 8th.