News for hackers. Stuff that matters.
Re:Gitlab Gitaly project now supports the SHA-256 hashing al... by yjftsjthsd-h on Monday August 28, 2023 @09:28PM (#37302453)
Clicking through to https://gitlab.com/gitlab-org/gitaly yields

> Gitaly is a Git RPC service for handling all the git calls made by GitLab

So I think this means that a major piece of gitlab now supports sha256 git repos? But probably not everything and therefore we can't actually push sha256 git repos to gitlab yet?

Re:Gitlab Gitaly project now supports the SHA-256 hashing al... by aaronmdjones on Monday August 28, 2023 @10:16PM (#37302762)
The answer to your question is in the first sentence of the article.
Re:Gitlab Gitaly project now supports the SHA-256 hashing al... by yjftsjthsd-h on Monday August 28, 2023 @11:27PM (#37303238)
Ah, now that I reread it, yes it does say

> While there is still some work we need to do in other parts of the GitLab application before SHA-256 repositories can be used, this milestone is important.

Somehow I managed to skim over and miss that; I was expecting a "what this means for gitlab" or "next steps" section.

Re:Gitlab Gitaly project now supports the SHA-256 hashing al... by jchw on Monday August 28, 2023 @10:24PM (#37302817)
Yeah, Gitaly is GitLab's approach to scaling up the actual Git operations. It's certainly a major part of the equation, but the article suggests the Rails app still has a bit of work to go before it's possible to use SHA256 repos.
Re:Gitlab Gitaly project now supports the SHA-256 hashing al... by natch on Monday August 28, 2023 @09:40PM (#37302515)
[delayed]
Re:Gitlab Gitaly project now supports the SHA-256 hashing al... by ronsor on Monday August 28, 2023 @09:56PM (#37302613)
best to avoid echo in the first place:

    printf '%s' "my string" | sha256sum
Re:Gitlab Gitaly project now supports the SHA-256 hashing al... by someplaceguy on Monday August 28, 2023 @10:03PM (#37302663)
Can you expand on why?
Re:Gitlab Gitaly project now supports the SHA-256 hashing al... by thristian on Monday August 28, 2023 @10:34PM (#37302904)
Because `echo -n` is a BSD-ism that's not supported on System V derivatives¹. It's perfectly legitimate for:

    echo -n "please hash this data"
...to output the bytes "-n please hash this data\n", which is even more misleading than the extra newline echo outputs normally.

¹: https://pubs.opengroup.org/onlinepubs/9699919799/utilities/e...

Re:Gitlab Gitaly project now supports the SHA-256 hashing al... by natch on Monday August 28, 2023 @10:54PM (#37303010)
Thanks for mentioning that! I learned something.
Re:Gitlab Gitaly project now supports the SHA-256 hashing al... by throw0101b on Tuesday August 29, 2023 @06:53AM (#37305826)

     The newline may also be suppressed by appending `\c' to the end of the
     string, as is done by iBCS2 compatible systems.  Note that the -n option
     as well as the effect of `\c' are implementation-defined in IEEE Std
     1003.1-2001 ("POSIX.1") as amended by Cor. 1-2002.  For portability, echo
     should only be used if the first argument does not start with a hyphen
     (`-') and does not contain any backslashes (`\'). If this is not suffi-
     cient, printf(1) should be used.
* https://man.freebsd.org/cgi/man.cgi?query=echo

     \c      Suppress the <newline> that otherwise follows
             the final argument in the output. All
             characters following the '\c' in the arguments
             shall be ignored.
* https://man7.org/linux/man-pages/man1/echo.1p.html
Re:Gitlab Gitaly project now supports the SHA-256 hashing al... by francislavoie on Monday August 28, 2023 @10:09PM (#37302706)
Because if you get in the habit of using printf instead of echo you can avoid having to remember to strip the newline when it matters and only add it when you need it. Though obviously echo is simpler to use for 95% of situations.
Re:Gitlab Gitaly project now supports the SHA-256 hashing al... by betaby on Monday August 28, 2023 @10:07PM (#37302691)
With the formated parameters '%s' it's instantly visible that there is no new line.
Re:Gitlab Gitaly project now supports the SHA-256 hashing al... by EspadaV9 on Monday August 28, 2023 @11:20PM (#37303187)
Hope you don't mind, but I opened up an MR to update the page with your code suggestion

https://gitlab.com/gitlab-com/www-gitlab-com/-/merge_request...

Re:Gitlab Gitaly project now supports the SHA-256 hashing al... by sytse on Tuesday August 29, 2023 @10:42AM (#37308687)
Thanks, merged.