smart-mobile-software / gitstack

GitStack makes you Git server easy to install and manage on Windows.
http://gitstack.com
Other
125 stars 41 forks source link

Parsing "config" files #109

Open nothingmn opened 12 years ago

nothingmn commented 12 years ago

I copied a git repo from one machine onto my GitStack machine, and the were some issus that GItStack could/should handle gracefully.

  1. Newlines. I SCP'd the original repo from a linux box, thus it treated newlines as "\n", where GitStack will only try to read "\r\n". I would recommend that GItStack first try the dfeault on windows "\r\n", but if that fails, try "\n". If that succeeds, rewrite the file.
  2. Tabs. In the "[core]" area of the config file the key's are tabbed in. This breaks GitStacks ability to parse the file. I would recommend we ignore tabs (or replace them out entirely).
poiuytrez commented 12 years ago

This is a complicated issue to fix. Python has issues to parse configuration files which has tabulation. When you use the "import" feature of GitStack, tabs are removed.

nothingmn commented 12 years ago

The import feature. The one place where I saw the ability to import was on the Repositories page. If a repo has not been fully recognized by GitStack it gives you the option to import. I found that if the config file (any config file in any repo) has tab issues the entire list of Repositories breaks. You cant even see the list to perform an import.

poiuytrez commented 11 years ago

So was the import feature working for you or not? Let me know if you have an example of a repository not recognized. If not, I will close the ticket.

tasmin commented 2 weeks ago

I was able to fix the tab parsing problem by fixing the regex OPTCRE in python/lib/ConfigParser.py (first two lines shown here, 2nd line was added by me):

    OPTCRE = re.compile(
        r'\s*'                                # ignore any starting white space [by Tasmin]