Попытка зафиксировать окончания строки с ответвлением фильтра мерзавца, но наличие никакой удачи

Я предполагаю, что Вы говорите о хранении структуры графика, если не тогда игнорируют...

, Если бы Ваше хранение графика, я лично думаю, лучшая идея реализовала бы функцию, которая преобразовывает Ваш график в матрицу смежности. Можно тогда сделать функцию, которая преобразовывает матрицу смежности в структуру данных графика.

Это обладает тремя преимуществами (который может или не может иметь значения в Вашем приложении):

  • матрица смежности является очень естественным способом создать, и сохранить график
  • можно создать матрицу смежности и импортировать их в приложения
  • , можно сохранить и считать данные значимым способом.

я использовал этот метод во время проекта CS и определенно, как я сделал бы это снова.

можно читать больше о матрице смежности здесь: http://en.wikipedia.org/wiki/Modified_adjacency_matrix

266
задан ROMANIA_engineer 8 November 2017 в 16:09
поделиться

2 ответа

Самый простой способ исправить это - сделать одну фиксацию, которая исправляет все окончания строк. Предполагая, что у вас нет измененных файлов, вы можете сделать это следующим образом.

# From the root of your repository remove everything from the index
git rm --cached -r .

# Change the autocrlf setting of the repository (you may want 
#  to use true on windows):
git config core.autocrlf input

# Re-add all the deleted files to the index
# (You should get lots of messages like:
#   warning: CRLF will be replaced by LF in <file>.)
git diff --cached --name-only -z | xargs -0 git add

# Commit
git commit -m "Fixed crlf issue"

# If you're doing this on a Unix/Mac OSX clone then optionally remove
# the working tree and re-check everything out with the correct line endings.
git ls-files -z | xargs -0 rm
git checkout .
388
ответ дан 23 November 2019 в 02:24
поделиться

The "| xargs fromdos" reads from standard input (the files find finds) and uses it as arguments for the command fromdos, which converts the line endings. (Is fromdos standard in those enviroments? I'm used to dos2unix). Note that you can avoid using xargs (especially useful if you have enough files that the argument list is too long for xargs):

find <path, tests...> -exec fromdos '{}' \;

or

find <path, tests...> | while read file; do fromdos $file; done

I'm not totally sure about your error messages. I successfully tested this method. What program is producing each? What files/directories do you not have permissions for? However, here's a stab at guessing what your it might be:

One easy way to get a 'file not found' error for the script is by using a relative path - use an absolute one. Similarly you could get a permissions error if you haven't made your script executable (chmod +x).

Add comments and I'll try and help you work it out!

3
ответ дан 23 November 2019 в 02:24
поделиться
Другие вопросы по тегам:

Похожие вопросы: