.gitattributes for linguist doesn't work correctly with gitlab - gitlab

I have a (private) project on Gitlab which uses GameMaker, and the .yy files were being detected as Yacc. I looked up how to change this, so I came across .gitattributes files, as described here and here. I created a .gitattributes file in the project directory with the following content:
*.yy linguist-language=GameMaker JSON
*.yy linguist-detectable=true
*.yyp linguist-language=GameMaker JSON
*.yyp linguist-detectable=true
The files are no longer being detected as Yacc, but they are also not detected as "GameMaker JSON", Gitlab now shows the repository as 100% GameMaker Language. I have tried both *.yy linguist-detectable syntax without the =true and with it, I have tried writing GameMaker-JSON with hyphens instead of spaces, and I have confirmed that the .gitattributes file was pushed onto the main branch (which is the only branch). How can I resolve this so that the .yy and .yyp files get recognized correctly, am I missing something?

It seems I mistakenly assumed that linguist allows you to specify custom language names in .gitattributes, but to my current knowledge, that is unfortunately not possible. I will henceforth specify to mark .yy and .yyp files as JSON in my project (refer to this comment I made), which I have already confirmed to work correctly.
My intention was to mark files that are specifically used as GameMaker project files or asset files (which are created and used by the GameMaker editor and not intended to be edited manually) differently from other files with JSON syntax (GameMaker also allows you to parse data from JSON files within your game code, these files would usually use the .json extension and not .yy or .yyp).
For now, it seems advisable for GameMaker projects to either specify .yy and .yyp as JSON or specify them to not be counted by linguist at all, since they aren't code that is manually written by the user.

Related

Merge schemas of custom dialog - Error conflicting definitions

I am following the steps of this page:
https://learn.microsoft.com/en-us/composer/how-to-create-custom-actions
and have reached to the part where it is required to merge the two schemas: bots and your custom one. However when running the powershell script found inside the created project template (CoreAssistant template) I have the following error:
Error conflicting definitions of HelpDialog.dialog :
C:\Users\user\source\repos\AvanadeCoreAssistant\AvanadeCoreAssistant\dialogs\imported\Microsoft.Bot.Components.HelpAndCancel\HelpDialog\HelpDialog.dialog
Microsoft.Bot.Components.HelpAndCancel:
C:\Users\user.nuget\packages\microsoft.bot.components.helpandcancel\1.1.2\exported\HelpDialog\HelpDialog.dialog
Error conflicting definitions of HelpDialog.en-us.lu.dialog :
C:\Users\user\source\repos\AvanadeCoreAssistant\AvanadeCoreAssistant\dialogs\imported\Microsoft.Bot.Components.HelpAndCancel\HelpDialog\recognizers\HelpDialog.en-us.lu.dialog
Microsoft.Bot.Components.HelpAndCancel:
C:\Users\user.nuget\packages\microsoft.bot.components.helpandcancel\1.1.2\exported\HelpDialog\recognizers\HelpDialog.en-us.lu.dialog
Error conflicting definitions of HelpDialog.lu.dialog
HelpDialog is a predefined dialog that was already present. I have installed NodeJs and #botframework-cli package because it was required from the powershell script in order to run bf dialog:merge and now it seems these two sources have some kind of conflict.
To add to other answers, changes that worked for me are as follows:
update-schema.ps1, line 11, change "!**/generated" to "!../generated" and add "!../dialogs/imported"
Also, make sure that your custom action project is INSIDE of your bot directory, it should be a folder next to the "schemas" folder for the script to find it.
Note/Edit: Having the project nested inside the bot works to get the script working, though I do not recommend it due to causing other errors. Oddly, I found it was best to move the whole custom solution up a level, next to the bot project. You may have to edit the [botName].sln file in notepad to reference the location of the project, as well as editing the bot project's project reference.
I fixed it by changing the script. I noticed the script was trying to ignore the folder imported and generated but the error message indicated it was not doing so. So I changed it from !**/generated to !../generated.
I experienced the same issue.
To fix this problem you could simply delete the corresponding dialogs in the "imported" folder. Note that this will, however, delete these dialogs in your bot, which is not optimal but should be of little concern for a sample application.

Retrieving projects without binary files

We have multiple very large perforce repositories with many binary files mixed in with source code. Is it possible to configure a client spec so that certain file extensions (e.g. zip, jar, war, etc.) are never synced to the local copy?
We are syncing periodically to generate metrics on source code, and for this purpose the binary files just get in the way.
In your client spec, use the "exclusionary" mappings, with a minus sign, as so:
View:
//depot/project/... //client-name/project/...
-//depot/project/.../*.zip //client-name/project/.../*.zip
-//depot/project/.../*.jar //client-name/project/.../*.jar
-//depot/project/.../*.war //client-name/project/.../*.war

Artefact folder structure does not contain empty directories

I'm trying to store whole the output of my build, this includes some empty folders. These aren't included by the artefact mechanism in teamcity:
What doesn't work:
OAR\=> OAR.zip
OAR->OAR.zip
OAR
Inside of OAR i have a folder structure that needs to be stored. I know i could put a placeholder file in each but that is not the answer i'm after. Otherwise ill have to zip it myself?
Unfortunately TeamCity, by design, searches for files and uploads them as artifacts which means that empty folders are never included. Given the open and very old issue in the TeamCity tracker I doubt they are going to fix it any time soon.
I would recommend zipping the folder yourself, that is the approach we have taken. How you implement that depends on the build technology you are using. For example, if you are building using Nant you could add the zip task to your build, there are similar options for MSBuild and Ant.
If you don't want to rely on the build performing the zip I would recommend installing 7zip on your build agents and using the command line to perform the zip. Just remember if you want 7zip to include empty directories use * as the wildcard rather than *. * like so:
7z a -r OAR.zip *
Technically you could use powershell to do the zipping, which would be better than having to install something on your agents. I haven't tried this option myself.
Apologies for not linking all my references above. Apparently, and understandably so, I need at least 10 reputation to post more than 2 links.

Layering projects on top of each other with git

Let there be:
There are different repositories repoA, repoB and repoC each respecting the same directory layout principles, which are to be merged onto a third repoM's working directory (the "master" project).
repoM has an atypical setup (--work-dir and --git-dir are sepparate). repo[A-C] are cloned as bare, and they are set as core.bare = false and core.worktree=<--work-dir-of-repoM>.
The requirements:
I need to always have an overview over the history of all files in repoM's work-dir, which could have stemmed from repo[A-C]. With this approach, I lose all that information.
Alternative:
I've been thinking about using git-subtree instead (git version 1.7.11.2, so it's already built-in), leaving repo[A-C] bare, and then
git pull -s subtree, or
git subtree ...
With the subtree pull strategy, I lose the history on a merge conflict (git blame says so).
I've never used subtree before, but from my understanding it's not possible to merge files from repo[A-C] into repoM's work-dir, those files must be put into a subdirectory of repo[A-C]. This is definitely not what I need. Why? Because of the following ...
Problem statement:
You have different git repositories each containing different sets of files, usually configuration files and some shell scripts. You want to put everything in the $HOME (which is <--work-dir-of-repoM>) directory from all those repositories. You should be able to see at all time where each file comes from, edit, commit and push changes to each one's origin. You've guessed it, it something like vundle, but generalized for any kind of configuration of any program, not just vim bundles. If a conflict occures, one should be able to track down which two authors of the same file need to get in touch with each other and make up a deal (if one needs to be made).
This is for an open-source project I'm trying to get a prototype working, so any help is highly appreciated. Also ideas about already existing projects which do this in a similar manner are highly appreciated.
Note: the "master directory" does not necessarily have to be $HOME, I've used it as a possible hint on the kind of problem this could solve.
Why not simply use Git Submodules in your "master project"?

Get specific Version (#Label) for an old version tree

I'm having some problem to get a specific Label version for an old tree path (moved, renamed, etc..) in TFS2008.
The problem I have is the following:
I renamed and moved some portion of tree version files and folder and now I'm not able to get a specific version from a specific Label. This Label was applied on the old tree path, and when I get specific version (with overwrite options checked) appear "Not downloaded" on the Latest column and I'm not able to work on the old baseline (labelled files and folder).
There is the way to get specific version in a custom target path?
The TFPT are helpful to do this?
Thanks!
The solution is get specific version Label on the project root, so the old tree version path is proposed.
Nicola Celiento: I was about to post this as new question when I saw your question and answer, which have also worked for me.
I had a branch called $/MyProject/Dev/OldName, which was renamed to $/MyProject/Dev/NewName in May 2015. I now want to get all the files for this branch as of April 2014 (before the branch rename), but I can't work out how to do this. So far I have tried:
Creating a new workspace mapped to $/MyProject/Dev/NewName. Do Get Specific Version on $/MyProject/Dev/NewName, set Type to Date as of April 2014, set Overwrite writeable files and Overwrite all files. This results in the message: "All files are up to date. No files were updated because the requested file versions were previously downloaded. To force an update, use the "Get Specific Version" command with the "Overwrite all...) option checked." This message is odd because it is telling me to do precisely what I have done to get the message! In Source Control Explorer all files have a status of Not downloaded.
From the command line, do a get using the new branch name (does not work - no files in workspace):
C:\Workspace>tf get $/MyProject/Dev/NewName /version:D"2014-04-08 21:00:00" /overwrite /force /recursive
All files are up to date.
From the command line, do a get using the old branch name (also does not work - no files in workspace):
C:\Workspace>tf get $/MyProject/Dev/OldName /version:D"2014-04-08 21:00:00" /overwrite /force /recursive
No appropriate mapping exists for $/MyProject/Dev/OldName.
Changed my workspace to map to the old branch $/MyProject/Dev/OldName, and then repeated the previous get (also does not work - no files in workspace):
C:\Workspace>tf get $/MyProject/Dev/OldName /version:D"2014-04-08 21:00:00" /overwrite /force /recursive
C:\Projects:
Getting OldName
Using View History on individual files, I can see the files definitely existed at April 2014, and I can also see their contents, I just can't get them for that date (but I can get them OK after the branch rename).
Based on Nicola Celiento's answer the solution for me was to Get Specific Version on the root $/MyProject/Dev project. This got all the branches below $/MyProject/Dev, including the old $/MyProject/Dev/OldName that I wanted.

Resources