cranequinier: (65x70)
cranequinier ([personal profile] cranequinier) wrote2015-02-11 09:33 pm

Git vs Mercurial чтоб сохранять timestamp-ы

Это пост для программистов. Вдруг кто чего подскажет.

Делаю новый репозиторий для глубоко приватных C++-ных исходников. Собираюсь его бесплатно хостить на Bitbucket, и доступаться к нему из пары-тройки мест на планете через SourceTree. Выбираю между Git и Mercurial. И вот меня скрутило - исходники, люди и процессы такие, что надо сохранять дату файлов на диске, хоть ты тресни. А оне оба - и Git и Mercurial - по-умолчанию ставят дату последнего слива с сервера. При этом Mercurial довольно просто фиксится примочкой TimestampMod Extension, и начинает даты файлов уважеть, а Git если и фиксится вообще, то как-то через задницу как и всё в Git. Поэтому я слегка скрипя сердцем склоняюсь к Mercurial, хотя знаю его похуже и вообще он какой-то умирающий.

Может я какую-то фигню делаю, а надо хостить где-то ещё, на своём хостинге, использовать SVN и переходить на Жабу? Вправьте мне скорее мозги... Ну чего вообще интересного есть в мире code hosting-а...

P.S. Мечта, конечно, fossil, но его считай что нету.

[identity profile] onanim.wordpress.com (from livejournal.com) 2015-02-12 11:23 pm (UTC)(link)
http: //git-scm. com /book/en/v2/ Customizing-Git-Git-Hooks

man githooks

Думается, post-merge надо попробовать.

"post-merge
This hook is invoked by git merge, which happens when a git pull is
done on a local repository. The hook takes a single parameter, a status
flag specifying whether or not the merge being done was a squash merge.
This hook cannot affect the outcome of git merge and is not executed,
if the merge failed due to conflicts.

This hook can be used in conjunction with a corresponding pre-commit
hook to save and restore any form of metadata associated with the
working tree (eg: permissions/ownership, ACLS, etc). See
contrib/hooks/setgitperms.perl for an example of how to do this."

(Но с вендой это будет забавная мастурбация, да-с (у нее вообще понятие mod time имеется? видимо, вместо перла какой-нибудь VBS юзать)... но если уж хочется непременно git - нет ничего невыполнимого).

[identity profile] onanim.wordpress.com (from livejournal.com) 2015-02-12 11:37 pm (UTC)(link)
(подумав) или, возможно, post-checkout.
"post-checkout
This hook is invoked when a git checkout is run after having updated
the worktree. The hook is given three parameters: the ref of the
previous HEAD, the ref of the new HEAD (which may or may not have
changed), and a flag indicating whether the checkout was a branch
checkout (changing branches, flag=1) or a file checkout (retrieving a
file from the index, flag=0). This hook cannot affect the outcome of
git checkout."

Whatever works.