The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My work

  • My badges

  • Twitter Updates

  • My Flickr Stream

    20140508-Delphi-2007--Project-Options--Cannot-Edit-Application-Title-HelpFile-Icon-Theming

    20140430-Fiddler-Filter-Actions-Button-Run-Filterset-now

    20140424-Windows-7-free-disk-space

    More Photos
  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,750 other followers

Archive for the ‘Source Code Management’ Category

Bitbucket – when you suddenly cannot login with git username/password from git any more

Posted by jpluimers on 2017/05/16

When logging in using the Web UI with a username

When logging in using the Web UI with a username

As of a few days, I was getting this error in my SourceTree output when pushing to git :

remote: Invalid username or password. If you log in via a third party service you must ensure you have an account password set in your account profile.

I think this is at least related to a change Bitbucket made 2 years ago for their site logon:

You can no longer log in with a username. Use your Atlassian account email address instead.

Source: Bitbucket

Pushing to bitbucket with cached credentials from SourceTree has worked for months. One thing that was different now (and should have given me a clue) the broken [WayBack] broken Git Credentials Manager popup showed but should not have.

When you get this credential manager you have to escape it as otherwise you will get an “Empty password” error.

Broken Git Credential Manager for Windows

Broken Git Credential Manager for Windows

Initially I blamed the error on the SourceTree 2.x upgrade I did last week. Unlike previous upgrades, this one had kept the old version (in my case 1.9.13.7) around and after a few clicks (skipping the “go to download page” prompt forever) and closing SourceTree 2.0, I fas able to start SourceTree 1.9 again.

SourceTree 1.9 had the same problem which meant it was either git itself, or the Bitbucket back-end.

To prove it was the Bitbucket back-end, I did everything An example of this is in the output below.

Solving the problem

What helped were these steps:

  1. Change the git repository from https://jeroenp@bitbucket.org/jeroenp/fastmm.git to
    https://bitbucket.org/jeroenp/fastmm.git
  2. Change the “username” field for the bitbucket repository to be my email address.
  3. Remove any bitbucket cached credentials from SourceTree.
  4. Restart SourceTree.
  5. Performing a push
  6. Cancel the Git Credential Manager popup
  7. Use my primary bitbucket email address for logon

Now SourceTree happily cached my credentials.

I’ve used this to scan the git config files for ones starting with a username:

grep -inSwl jeroenp@bitbucket config

Notes:

From the console

Reproduction of the issue:

C:\Users\jeroenp\Versioned\FastMM>git --version
git version 2.12.2.windows.1

C:\Users\jeroenp\Versioned\FastMM>git -c diff.mnemonicprefix=false -c core.quotepath=false push -v --tags --set-upstream bitbucket develop:develop
Pushing to https://jeroenp@bitbucket.org/jeroenp/fastmm.git
Logon failed, use ctrl+c to cancel basic credential prompt.
Password for 'https://jeroenp@bitbucket.org/':
remote: Invalid username or password. If you log in via a third party service you must ensure you have an account password set in your account profile.
fatal: Authentication failed for 'https://jeroenp@bitbucket.org/jeroenp/fastmm.git/'

This has worked for months (after [WayBack] canceling the Git Credentials Manager popup as that has been broken for a very long time and gives you a remote: Empty password).

What helped was this:

C:\Users\jeroenp\Versioned\FastMM>git -c diff.mnemonicprefix=false -c core.quotepath=false push -v --tags --set-upstream bitbucket develop:develop
Pushing to https://bitbucket.org/jeroenp/fastmm.git
Logon failed, use ctrl+c to cancel basic credential prompt.
Username for 'https://bitbucket.org/': jeroen...@....com
Password for 'https://jeroen...@....comcom@bitbucket.org/':
Total 0 (delta 0), reused 0 (delta 0)
POST git-receive-pack (196 bytes)
remote:
remote: Create pull request for develop:
remote:   https://bitbucket.org/jeroenp/fastmm/pull-requests/new?source=develop&t=1
remote:
To https://bitbucket.org/jeroenp/fastmm.git
   xxxxxxxx..xxxxxxxx  develop -> develop
updating local tracking ref 'refs/remotes/bitbucket/develop'
Branch develop set up to track remote branch develop from bitbucket.

–jeroen

 

 

Posted in BitBucket, Development, DVCS - Distributed Version Control, git, Software Development, Source Code Management | Leave a Comment »

git encoding trouble: recursively removing a directory where git prints out a different name than it accepts

Posted by jpluimers on 2017/05/11

The story so far:

A few years back I put all my conferences material in a GitHub repository https://github.com/jpluimers/Conferences/. There were a lot directories and files so I didn’t pay much attention to the initial check-in list. The files had been part of copy.com syncing between Windows and Mac machines.

Often git on a Mac is a bit easier than on Windows (on a Mac you can install them with the xcode-select --install trick which installs only the Command Line Tools without having to install the full Xcode [WayBack]).

I choose a Mac because it is closer to a Linux machine than Widows so I expected no encoding trouble (as git has a Linux origin: it “was created by Linus Torvalds in 2005 for development of the Linux kernel“).

Boy I was wrong:

Recently I cloned the repository in a different place and found out a few strange things:

  1. Directories with accented characters had been duplicated, for instance in https://github.com/jpluimers/Conferences/tree/master/2011
    1. …/EKON15-Renaissance-Hotel-D%FCsseldorf
    2. …/EKON15-Renaissance-Hotel-Düsseldorf
  2. Beyond Compare would show the same content
  3. After a check-out git would not understand the %FC encoded directory name (%FC is IEC_8859-1 encoding for ü and \374 is the octal representation of 0xFC [WayBack]) and a git status would show stuff like this:
    • Untracked files:
        (use "git add ..." to include in what will be committed)
      
          EKON15-Renaissance-Hotel-D%FCsseldorf/

      or

      deleted: "EKON15-Renaissance-Hotel-D\374sseldorf/Delphi-XE2-Debugging/BO-EKON15-Delphi-XE2-Debugging.pdf"
  4. A git rm -r --cached call [WayBack] would not work, as both these would fail:
    • $ git rm -r --cached EKON15-Renaissance-Hotel-D%FCsseldorf
      fatal: pathspec 'EKON15-Renaissance-Hotel-D%FCsseldorf' did not match any files
      

      and

      $ git rm -r --cached "EKON15-Renaissance-Hotel-D\374sseldorf"
      fatal: pathspec 'EKON15-Renaissance-Hotel-D\374sseldorf' did not match any files
      
  5. a

So git could:

  • detect the directories and files
  • display the names of the detected directories and files
  • not translate back the specified names into directories and files

All if this was with:

$ git --version
git version 1.9.5 (Apple Git-50.3)

This is how I fixed it

First I created an alias:

alias git-config="echo global: ; git config --list --global ; echo local: ; git config --lis --local ; echo system: ; git config --list --system"

That allowed me to view the git settings on various levels in my system.

It revealed I didn’t have the core.precomposeunicode setting at all (valid values are true or false). I also read various stories about one or both being the correct value: osx – Git and the Umlaut problem on Mac OS X – Stack Overflow [WayBack].

 

 

–jeroen

Result of git status:

 

Posted in Development, DVCS - Distributed Version Control, git, Source Code Management | Leave a Comment »

Research list: export issues from Bitbucket to import them later

Posted by jpluimers on 2017/05/10

This has been bugging me for a while: some Bitbucket repositories are abandoned but have a useful list of issues.

When forking them, you don’t get the issues and you cannot export them either (because the source repository is not yours).

Some links that might help me get started to solve this:

Being able to import from a non-exportable repository would allow me to keep issue # references in sync which would make it a lot easier for relating commit history with issues.

–jeroen

Posted in BitBucket, Development, Source Code Management | Leave a Comment »

Comparing commits across time – via github User Documentation

Posted by jpluimers on 2017/05/02

To get to the compare view, append /compare to your repository’s path.

This brings you the basic comparison interface which is very flexible: just enter a branch, tag or history marker in the dropdowns for base and compare.

Examples from the user docs:

–jeroen

Source: Comparing commits across time – User Documentation

Posted in Development, DVCS - Distributed Version Control, git, GitHub, Software Development, Source Code Management | Leave a Comment »

Easily print GitHub markdown as beautiful PDFs that – in Chrome – immediately download

Posted by jpluimers on 2017/04/26

Printing Markdown with GitPrint

Simply view any Markdown file on GitHub, then in your URL bar replace the github.com part of the URL with gitprint.com — your markdown file will be rendered to a beautiful, printable PDF.

Try an example https://gitprint.com/jquery/jquery/blob/master/README.md

Every once in a while I feel like I’ve been living under a stone for years. Today is such a day as gitprint has been around since 2014 and I only noticed it until now.

It’s cool as it prints any github page (including Markdown, RestructuredText, etc) as a PDF file.

Notes:

  • The PDF file is named after the url. For the above example, the PDF is gitprint__-jquery-jquery-blob-master-README.md.pdf
  • In my browsers, it directly starts downloading the PDF file.
  • There is a bookmarklet on the gitprint home page for easy browser integration
  • There is a gitprint Chrome Extension for even better integration into chrome (it modifies the github.com pages to add printing support)
  • It’s https too (truckloads of web-sites could learn from that).

–jeroen

Source: Easily print GitHub markdown as beautiful PDFs

Posted in Development, DVCS - Distributed Version Control, git, GitHub, Software Development, Source Code Management | Leave a Comment »

 
%d bloggers like this: