How to add all files (added, modified, deleted) to index using JGit? - jgit

I am trying to use JGit to add all files to the index (stage area).
By doing git.add().addFilepattern(".").call() I get to add modified and new ones. But not deleted ones.
How to add all deleted ones as well?
I tried git.add().addFilepattern("-u") but it does not work.
Related question (about adding specific deleted files, not all deleted files): How can I use JGit to add deleted files to the index?

Have you tried using setUpdate(boolean) ?
// fair warning : not tested, I only read JGit's doc
git.add().setUpdate(true).call()
// or
git.add().setUpdate(true).addFilepattern(".").call()

Related

Cannot place custom items on client hotbar/toolbar

Whenever I make a custom item, I am unable to drag it onto a hotbar. When I try to pick it up the icon turns to a question mark and will not stick to a hotkey.
For example, I made an exact copy of the Murloc Costume (id 33079) at id 50017 (which was a free slot on my DB). The original I can put on a hotbar. The custom one I cannot.
Here's a gif of the issue
Answer: if it's not in the client side DBC's, it will not work properly.
From ReynoldsCahoon on the AC Discord:
I just modified a DBC recently. I had to use a tool (I used Ladik's MPQ Editor) to extract the specific DBC I wanted to modify, and then I used WDBX to open the DBC and manipulate it. In WDBX you can output it in a variety of formats (like CSV or SQL) so you can modify the values any way you like, and then reimport (via CSV or SQL) the values back in.
I loosely followed the guide here: https://model-changing.net/tutorials/article/23-41-creating-your-first-mpq-patch/
I exported a DBC containing all of the Character Titles in the game. Erased all of them, and then imported a bunch of new values of my own choosing. Instead of importing that back into the MPQ I got it from, I created a new MPQ called patch-4.mpq that I placed in my client WotLK/Data/ directory, and then on the server, I placed the DBC file into the worldserver/data/dbc/ directory, replacing the original DBC.
I think this can optionally be overwritten in the database, by using the associated _dbc table to override values from the dbc files (someone correct me if this part is wrong).

Why is object in AOT marked with red cross?

I have to extend report's query to add a new field.
I've created extension of a query, joined required datasources and can see new field in the list of fields.
For some reason the report in the AOT is displaying with red cross sign:
In properties i can see error in metadata: "There was an error reading metadata. Make sure the metadata xml file(s) are accessible, are well formed and are not corrupted with duplicate or missing xml elements.
The exception message is: Element named: 'Copy1' of type 'ModelElement' already exists among elements: 'Copy1'.
Parameter name: item
Additional information:
AOT/Reports/Reports/WHSInvent"
There is an .xml of that object in packages local directory, there are no any duplicate names in any node of that report.
Any ideas how it can be fixed?
I've run into this before and there are a two things that come to mind.
Often times it's due to an incorrect merge where changes are merged and metadata is accidentally duplicated (in your case it's possible there are two xml nodes with the same name/id in the .rdl file)
If this report is checked in with corrupt metadata, you need to manually modify the RDL file, which is not great, but hopefully the error contains enough hints. Open the report rdl file in your favourite editor (report likely located in a similar path as this: K:\AosService\PackagesLocalDirectory\YOURMODEL\Reports) and look for an xml node with an attribute Name="Copy1". With luck, you have two duplicate nodes next to each other due to the merge. Remove the offending duplicate node, save, and refresh the AOT in Visual Studio.
If the error is in your local changes only (xml file is corrupted for whatever reason) and you are sure that your source control contains the correct version and you simply wish to overwrite the local contents with the source controlled version, follow these steps. Note: this will overwrite local changes.
First, undo pending changes.
Then force a get latest:

changing file names, how to?

I've created some forms following this approach:
iron g:template cars/create_car
and the following files were created:
create_car.css
create_car.html
create_car.js
Easy question - if I want to change the name of the files where else do I have to update to keep my changes in sync with the rest of the application?
Thank you!
Mark
You won't be out of sync by changing file's name.
The only things which would change is the file load order, according to the documentation:
HTML template files are always loaded before everything else.
Files beginning with main. are loaded last
Files inside any lib/ directory are loaded next
Files with deeper paths are loaded next
Files are then loaded in alphabetical order of the entire path
On your case It's wouldn't probably cause any issue, feel free to test.

SAP HANA custom dictionary: full-text-index not generated or updated

There are two problems with SAP HANA custom dictonaries.
Updating and recompiling the dictionary has no effect on the full-text-index table (even by dropping and generating the full-text-index again)
using custom dictionaries & configuration may lead to an empty fulltext-index-table
For the 1. Problem
deleting the configuration file and replace it with a new file (same content but different file name) then activating all changes (activates the deletion of the old config and adds the new config) seems to be a work-around.
Note: this means you also have to change the configuration name in the SQL command.
For the 2. Problem
Check this trace file:
/usr/sap/HDB/HDB00/hanadb/trace/preprocessor_alert_hanadb.trc
This error message:
File read Error '/usr/sap/HDB/SYS/global/hdb/custom/config/lexicon//EXTRACTION_CORE_MOD2', error='Storage object does not exist: $STORAGEOBJECT$'
occurs if the configuration file EXTRACTION_CORE_MOD2 is not properly activated in the repository under sap.hana.ta.config. So double check the repository if the configuration file exists in the specified path.
For the first problem, I have the same scenario in which I need to make some changes in the custom dictionary and activated it. It did not affect my index table unit I run the following statement:
ALTER INDEX MYINDEX REBUILD;
I have checked it and the changes affect the index table by this statement. So you do not have to remove your index or save the changes of your custom dictionary in a file with new name.

Drupal 7 deleting node does not delete all associated files

One file gets upload when the node is created via standard Drupal.
Later, 2 files are added to the node via:
file_save(std Class)
file_usage_add(std Class, 'module', 'node', $node_id)
At the end, I end up with 3 entries in file_managed and file_usage.
Problem: when I delete the node via standard Drupal, the file that was added during the initial node creation gets removed, but not the 2 that were added later. These files remain in both tables, and physically on the disk.
Is there some flag that is being set to keep the files even if the node is deleted? If so, where is this flag, and how do I set it correctly (to be removed along with the node)?
The answer is in the file_delete() function, see this comment:
// If any module still has a usage entry in the file_usage table, the file// will not be deleted
As your module has declared an interest in the file by using file_usage_add() it will not be deleted unless your module explicitly says it's OK to do so.
You can either remove the call to file_usage_add() or implement hook_file_delete() and use file_usage_delete() to ensure the file can be deleted:
function mymodule_file_delete($file) {
file_usage_delete($file, 'mymodule');
}
You can force deleting of file.
file_delete($old_file, TRUE);
But make sure that this file is not used in other nodes using:
file_usage_list($file);

Resources