169 похожих чатов

Hi guys, does anyone knows a git command to check

it there are some pending changes? I'm looking for something machine-friendly to include on a script

11 ответов

88 просмотров

Git status

Лунная Задача
Git status

Yhea but: 1 is not machine-friendly 2 is kind of overkill (I need to check IF there are chenges not have a list of them) 3 is a porcelain command...

What's the script's purpose?

Ветреный Стек
What's the script's purpose?

Check if you have changes if yes -> stash fetch pull If you had changes ->stash pop

Сосредоточенная Картина
Check if you have changes if yes -> stash fetch pu...

Just use the "overkill" solution and make a 1/0 state out of it. Doesn't the return code differ?

Ветреный Стек
Just use the "overkill" solution and make a 1/0 st...

Sorry what does "make a 1/0 state out of it" means? (English is not my first language)

Ветреный Стек
True/false. Doesn't matter your original output is...

True but it also means that probably git will have to do more stuffs before giving me back the result (not that performance is a concern but if I can...)

Сосредоточенная Картина
True but it also means that probably git will have...

>performance is not a concern Commit the existing solution and move on, go burn time on something else

Сосредоточенная Картина
True but it also means that probably git will have...

So long, goodbye, had to do it for my own things. repoPath='/path/to/repository' # Optionally add --untracked-files=no if [[ $(git -C "${repoPath}" status --porcelain) ]]; then echo "Output present: Changes detected" else echo "No output: No changes" fi

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

Обсуждают сегодня

Господа, а что сейчас вообще с рынком труда на делфи происходит? Какова ситуация?
Мелодичный Сырник
29
А вообще, что может смущать в самой Julia - бы сказал, что нет единого стандартного подхода по многим моментам, поэтому многое выглядит как "хаки" и произвол. Короче говоря, с...
Фетровый Лингвист
2
30500 за редактор? )
Замшевый Алхимик
47
а через ESC-код ?
Виноградная Притча
29
Чёт не понял, я ж правильной функцией воспользовался чтобы вывести отладочную информацию? но что-то она не ловится
Сентиментальная Вершина
18
У меня есть функция где происходит это: write_bit(buffer, 1); write_bit(buffer, 0); write_bit(buffer, 1); write_bit(buffer, 1); write_bit(buffer, 1); w...
Отзывчивая Шестерёнка
14
Добрый день! Скажите пожалуйста, а какие программы вы бы рекомендовали написать для того, чтобы научиться управлять памятью? Можно написать динамический массив, можно связный ...
Клюквенный Як
7
Недавно Google Project Zero нашёл багу в SQLite с помощью LLM, о чём достаточно было шумно в определённых интернетах, которые сопровождались рассказами, что скоро всех "ибешни...
Волшебный Ленивец
5
Ребят в СИ можно реализовать ООП?
Стеклянный Граммофон
33
https://github.com/erlang/otp/blob/OTP-27.1/lib/kernel/src/logger_h_common.erl#L174 https://github.com/erlang/otp/blob/OTP-27.1/lib/kernel/src/logger_olp.erl#L76 15 лет назад...
Укропная Путница
20
Карта сайта