Emandhal / MCP251XFD

MCP2517FD, MCP2518FD and MCP251863 driver
MIT License
30 stars 6 forks source link

Broken Symlinks? #8

Closed mickeyl closed 10 months ago

mickeyl commented 10 months ago

When trying to clone (or unzip) the project here on Linux (Ubuntu-derivate), I'm getting lots of errors due to the files not being able to resolve:

~/D/l/misc  git clone https://github.com/mjh9585/MCP251XFD.git                                                                                                                                       Fr 17 Nov 2023 17:59:26 CET
Cloning into 'MCP251XFD'...
remote: Enumerating objects: 497, done.
remote: Counting objects: 100% (497/497), done.
remote: Compressing objects: 100% (335/335), done.
remote: Total 497 (delta 230), reused 399 (delta 132), pack-reused 0
Receiving objects: 100% (497/497), 8.65 MiB | 2.06 MiB/s, done.
Resolving deltas: 100% (230/230), done.
error: unable to create symlink CRC/CRC16_CMS.c: File name too long
error: unable to create symlink CRC/CRC16_USB.c: File name too long
error: unable to create symlink CRC/CRC_CAN.c: File name too long
error: unable to create symlink CRC/CRC_CAN.h: File name too long
error: unable to create symlink ErrorsDef.h: File name too long
error: unable to create symlink MCP251XFD.c: File name too long
error: unable to create symlink MCP251XFD.h: File name too long
fatal: unable to checkout working tree
warning: Clone succeeded, but checkout failed.
You can inspect what was checked out with 'git status'
and retry with 'git restore --source=HEAD :/'

And indeed, something really strange is going on, as the symlink seems to point to the actual contents:

~/D/l/m/MCP251XFD   ~…  cd CRC/                                                                                                                                                                    Fr 17 Nov 2023 18:00:02 CET
 ~/D/l/m/MCP251XFD   ~…  CRC  ls -la                                                                                                                                                               Fr 17 Nov 2023 18:00:05 CET
lrwxrwxrwx 2,1k mickey 17 Nov 17:59  CRC16_CMS.h -> /*******************************************************************************\r\n    File name:    CRC16_CMS.h\r\n    Author:       FMA\r\n    Version:      1.0\r\n    Date (d/m/y): 14/05/2020\r\n    Description:  CRC16-CMS implementation\r\n                  The CRC16-CMS polynomial is x^16 + x^15 + x^5 + 1 (0x8005)\r\n                  Does not use RefIN and RefOUT, the initial value 0xFFFF\r\n                  The result is XORed with 0x0000\r\n                  http://reveng.sourceforge.net/crc-catalogue/16.htm\r\n\r\n    History :\r\n*******************************************************************************/\r\n#ifndef CRC16_CMS_H_INC\r\n#define CRC16_CMS_H_INC\r\n//=============================================================================\r\n\r\n//-----------------------------------------------------------------------------\r\n#include <stdint.h>\r\n#include <stdbool.h>\r\n#include <stddef.h>\r\n#include <stdlib.h>\r\n//-----------------------------------------------------------------------------\r\n/// @cond 0\r\n/**INDENT-OFF**/\r\n#ifdef __cplusplus\r\nextern "C" {\r\n#endif\r\n/**INDENT-ON**/\r\n/// @endcond\r\n//-----------------------------------------------------------------------------\r\n\r\n\r\n\r\n\r\n\r\n#ifndef CRC16CMS_NOTABLE\r\n/*! @brief Compute a byte stream with CRC16-CMS with a table\r\n *\r\n * @param[in] *data Is the pointed byte stream\r\n * @param[in] size Is the size of the pointed byte stream\r\n * @return The CRC computed\r\n */\r\nuint16_t ComputeCRC16CMS(const uint8_t* data, uint32_t size);\r\n\r\n#else\r\n\r\n/*! @brief Compute a byte stream with CRC16-CMS without a table\r\n *\r\n * @param[in] *data Is the pointed byte stream\r\n * @param[in] size Is the size of the pointed byte stream\r\n * @return The CRC computed\r\n */\r\nuint16_t ComputeCRC16CMS(const uint8_t* data, uint16_t size);\r\n\r\n#endif\r\n\r\n\r\n\r\n\r\n\r\n//-----------------------------------------------------------------------------\r\n/// @cond 0\r\n/**INDENT-OFF**/\r\n#ifdef __cplusplus\r\n}\r\n#endif\r\n/**INDENT-ON**/\r\n/// @endcond\r\n//-----------------------------------------------------------------------------\r\n#endif /* CRC16_CMS_H_INC */
lrwxrwxrwx 2,0k mickey 17 Nov 17:59  CRC16_USB.h -> /*******************************************************************************\r\n    File name:    CRC16_USB.h\r\n    Author:       FMA\r\n    Version:      1.0\r\n    Date (d/m/y): 09/03/2020\r\n    Description:  CRC16-USB implementation\r\n                  The CRC16_USB polynomial is x^16 + x^15 + x^5 + 1 (0x8005)\r\n                  Use RefIN and RefOUT, the initial value 0xFFFF\r\n                  The result is XORed with 0xFFFF\r\n          http://reveng.sourceforge.net/crc-catalogue/16.htm\r\n\r\n    History :\r\n*******************************************************************************/\r\n#ifndef CRC16_USB_H_INC\r\n#define CRC16_USB_H_INC\r\n//=============================================================================\r\n\r\n//-----------------------------------------------------------------------------\r\n#include <stdint.h>\r\n#include <stdbool.h>\r\n#include <stddef.h>\r\n#include <stdlib.h>\r\n//-----------------------------------------------------------------------------\r\n/// @cond 0\r\n/**INDENT-OFF**/\r\n#ifdef __cplusplus\r\nextern "C" {\r\n#endif\r\n/**INDENT-ON**/\r\n/// @endcond\r\n//-----------------------------------------------------------------------------\r\n\r\n\r\n\r\n\r\n\r\n#ifndef CRC16USB_NOTABLE\r\n/*! @brief Compute a byte stream with CRC16-USB with a table\r\n *\r\n * @param[in] *data Is the pointed byte stream\r\n * @param[in] size Is the size of the pointed byte stream\r\n * @return The CRC computed\r\n */\r\nuint16_t ComputeCRC16USB(const uint8_t* data, uint32_t size);\r\n\r\n#else\r\n\r\n/*! @brief Compute a byte stream with CRC16-USB without a table\r\n *\r\n * @param[in] *data Is the pointed byte stream\r\n * @param[in] size Is the size of the pointed byte stream\r\n * @return The CRC computed\r\n */\r\nuint16_t ComputeCRC16USB(const uint8_t* data, uint16_t size);\r\n\r\n#endif\r\n\r\n\r\n\r\n\r\n\r\n//-----------------------------------------------------------------------------\r\n/// @cond 0\r\n/**INDENT-OFF**/\r\n#ifdef __cplusplus\r\n}\r\n#endif\r\n/**INDENT-ON**/\r\n/// @endcond\r\n//-----------------------------------------------------------------------------\r\n#endif /* CRC16_USB_H_INC */

Any idea what's going wrong here?

Emandhal commented 10 months ago

Hi,

I have no idea what's going on here... I remember that first I commit the symlinks by mistake and I correct this the commit following after.

I don't know why you have this problem

mickeyl commented 10 months ago

I guess you're working on Windows, which handle symlinks a tad bit differently than the rest of the world. Anyways, issuing git config --add core.symlinks false seems to fix it here.