git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / Atom feed
* [GSoC] Shourya's Blog
@ 2020-06-28  9:39 Shourya Shukla
  0 siblings, 0 replies; 9+ messages in thread
From: Shourya Shukla @ 2020-06-28  9:39 UTC (permalink / raw)
  To: git; +Cc: christian.couder, kaartic.sivaraam, gitster, dstolee

Hello all!

This is the eighth installation of my weekly blog covering what I have
learned in GSoC and other like stuff.
https://shouryashukla.blogspot.com/2020/06/gsoc-week-8.html

Feel free to comment!

Regards,
Shourya Shukla

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [GSoC] Shourya's Blog
@ 2020-07-05 18:38 Shourya Shukla
  0 siblings, 0 replies; 9+ messages in thread
From: Shourya Shukla @ 2020-07-05 18:38 UTC (permalink / raw)
  To: git
  Cc: christian.couder, kaartic.sivaraam, gitster, Johannes.Schindelin,
	philipoakley

Hello all!

This is the ninth installation of my weekly blog covering what I have
learned in GSoC and other like stuff.
https://shouryashukla.blogspot.com/2020/07/gsoc-week-9.html

Feel free to comment!

Regards,
Shourya Shukla

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [GSoC] Shourya's Blog
@ 2020-06-23 18:14 Shourya Shukla
  0 siblings, 0 replies; 9+ messages in thread
From: Shourya Shukla @ 2020-06-23 18:14 UTC (permalink / raw)
  To: git; +Cc: kaartic.sivaraam, gitster, christian.couder

Hello all!

This is the seventh installation of my weekly blog covering what I have
learned in GSoC and other like stuff.
https://shouryashukla.blogspot.com/2020/06/gsoc-week-7.html

Feel free to comment!

Regards,
Shourya Shukla

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [GSoC] Shourya's Blog
  2020-06-17  8:38 ` Kaartic Sivaraam
@ 2020-06-20  6:55   ` Shourya Shukla
  0 siblings, 0 replies; 9+ messages in thread
From: Shourya Shukla @ 2020-06-20  6:55 UTC (permalink / raw)
  To: Kaartic Sivaraam; +Cc: christian.couder, git, gitster

On 17/06 02:08, Kaartic Sivaraam wrote:
> Some things I noted in the blog:
> 
> > As far as I have learned, summary prints a git log --oneline
> > between the revision checked out in the submodule and the
> > revision superproject assumed the submodule to be in (i.e.,
> > the one checked out in the superproject).
> 
> The explanation is pretty close. The wording could be tweaked a little
> to be more precise. Particularly "assume" isn't a proper word to
> explain the working of summary. It works based on facts not
> assumptions. Something along the lines of:

Thanks for the feedback. I couldn't think of a word back then! Will make
amends.

>     As far as I have learned, summary prints a git log --oneline
>     between the revision checked out in the submodule and the revision
>     "known" to the superproject (i.e., the revision found in the index
>     of the superproject).
> 
> >  If no revision is specified of the submodule then we assume it to be HEAD
> 
> As discussed elsewhere, the revision passed to the summary command is
> the revision of the superproject and not the revision of the submodule.

Alright! Will amend.

> > $ git submodule summary my-subm
> >   * my-subm abc123..def456
> >     < some commit
> >     < another commit
> >     < some another commit 
> 
> While the command above would produce the result you mention when
> 'my-subm' in the repo. The command itself is incorrect if it's
> intention is to print "only" the summary of 'my-subm'. This is the
> format of the 'summary' sub-command according to the doc:
> 
>     summary [--cached|--files] [(-n|--summary-limit) <n>] [commit] [--]
> [<path>...]
> 
> So, it expects a 'commit' followed by the 'path'. As you had passed the
> path as the first argument it would be treated as the 'commit' argument.
> As 'my-subm' is likely not a valid commit-ish, the script would
> default to 'HEAD' (the final else mentioned below) and would
> print the summary of all the submodules. IOW, it just prints the
> same output as:
> 
>    $ git submodule summary
> 
> in this case.

I just took the case of only one submodule existing in the superproject.
Though even my output isn't wrog, the path taken to achieve it is a bit
ambiguous. I will change it.

> > else
> > 	head="HEAD"
> > fi
> >
> > This means that if the above 2 cases fail (which will most probably
> > lead to presence of commits yet a failure in git rev-parse --verify)
> > then make head as HEAD.
> 
> Characterising 'git rev-parse --verify ...' as not being able to print
> the hash of a commit even when there is one in the repo seems incorrect
> to me. There are other more likely cases which would lead to rev-parse
> failing and that last else part getting executed. For instance, an
> incorrect ref being passed as the first argument to the summary
> sub-command like:
> 
>     git submodule summary no-such-ref-exists
> 
> or
>      git submodule summary "invalid ref"

Oh! I did not think this one! I will change this too. Thank you so much
for pointing this out.

Regards,
Shourya Shukla

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [GSoC] Shourya's Blog
  2020-06-16  7:21 Shourya Shukla
  2020-06-17  8:38 ` Kaartic Sivaraam
@ 2020-06-17 20:35 ` Junio C Hamano
  1 sibling, 0 replies; 9+ messages in thread
From: Junio C Hamano @ 2020-06-17 20:35 UTC (permalink / raw)
  To: Shourya Shukla; +Cc: git, kaartic.sivaraam, christian.couder

Shourya Shukla <shouryashukla.oo@gmail.com> writes:

> Hello all!
>
> This is the sixth installation of my weekly blog covering what I have
> learned in GSoC and other like stuff.
> https://shouryashukla.blogspot.com/2020/06/gsoc-week-55.html
>
> Feel free to comment!

This like looked unusual:

    var1=${var1:=$var2}

What's inside ${...} is sufficient to assing to var1 when it is not
uset or set to an empty string.  It is far more common to say

    : ${var1:=$var2}

with or without the colon in front of the equal sign (which tells
the construct to treat "set to empty" the same way as "unset").


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [GSoC] Shourya's Blog
  2020-06-16  7:21 Shourya Shukla
@ 2020-06-17  8:38 ` Kaartic Sivaraam
  2020-06-20  6:55   ` Shourya Shukla
  2020-06-17 20:35 ` Junio C Hamano
  1 sibling, 1 reply; 9+ messages in thread
From: Kaartic Sivaraam @ 2020-06-17  8:38 UTC (permalink / raw)
  To: Shourya Shukla; +Cc: git, gitster, christian.couder

Hi Shourya,

On 16-06-2020 12:51, Shourya Shukla wrote:
> Hello all!
> 
> This is the sixth installation of my weekly blog covering what I have
> learned in GSoC and other like stuff.
> https://shouryashukla.blogspot.com/2020/06/gsoc-week-55.html
> 
> Feel free to comment!
> 

Some things I noted in the blog:

> As far as I have learned, summary prints a git log --oneline
> between the revision checked out in the submodule and the
> revision superproject assumed the submodule to be in (i.e.,
> the one checked out in the superproject).

The explanation is pretty close. The wording could be tweaked a little
to be more precise. Particularly "assume" isn't a proper word to
explain the working of summary. It works based on facts not
assumptions. Something along the lines of:

    As far as I have learned, summary prints a git log --oneline
    between the revision checked out in the submodule and the revision
    "known" to the superproject (i.e., the revision found in the index
    of the superproject).

>  If no revision is specified of the submodule then we assume it to be HEAD

As discussed elsewhere, the revision passed to the summary command is
the revision of the superproject and not the revision of the submodule.

> $ git submodule summary my-subm
>   * my-subm abc123..def456
>     < some commit
>     < another commit
>     < some another commit 

While the command above would produce the result you mention when
'my-subm' in the repo. The command itself is incorrect if it's
intention is to print "only" the summary of 'my-subm'. This is the
format of the 'summary' sub-command according to the doc:

    summary [--cached|--files] [(-n|--summary-limit) <n>] [commit] [--]
[<path>...]

So, it expects a 'commit' followed by the 'path'. As you had passed the
path as the first argument it would be treated as the 'commit' argument.
As 'my-subm' is likely not a valid commit-ish, the script would
default to 'HEAD' (the final else mentioned below) and would
print the summary of all the submodules. IOW, it just prints the
same output as:

   $ git submodule summary

in this case.

> elif test -z "$1" || test "$1" = "HEAD"
> then
> 	# before the first commit: compare with an empty tree
> 	head=$(git hash-object -w -t tree --stdin </dev/null)
> 	test -z "$1" || shift
> 
> This part checks if there are any commits in our tree (of the submodule) or not.

Again, it's the tree of the superproject that we're concerned about.

> If there aren’t any commits then it simulates an empty repo environment
> using head=$(git hash-object -w -t tree --stdin </dev/null). The
> /dev/null is the UNIX null device and is sort of a blackhole meaning
> things if gone into it completely disappear never to be seen again.

Fine. As we're using '/dev/null' as an input here. It would've been nice
if you had also mentioned that it serves as a "convenient empty file for
input streams"[1] because "reads from /dev/null always return end of
file"[2].

> Making stdin as /dev/null means giving nothing as input hence
> nothing to create a hash object of.

Not precise. That command would return the hash of an empty tree.

> else
> 	head="HEAD"
> fi
>
> This means that if the above 2 cases fail (which will most probably
> lead to presence of commits yet a failure in git rev-parse --verify)
> then make head as HEAD.

Characterising 'git rev-parse --verify ...' as not being able to print
the hash of a commit even when there is one in the repo seems incorrect
to me. There are other more likely cases which would lead to rev-parse
failing and that last else part getting executed. For instance, an
incorrect ref being passed as the first argument to the summary
sub-command like:

    git submodule summary no-such-ref-exists

or

    git submodule summary "invalid ref"

So, I think it would've been precise to just say:

    This means that if the above 2 cases fail then we make
    head as HEAD.

[1]: https://en.wikipedia.org/wiki/Null_device
[2]: https://man7.org/linux/man-pages/man4/null.4.html

-- 
Sivaraam

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [GSoC] Shourya's Blog
@ 2020-06-16  7:21 Shourya Shukla
  2020-06-17  8:38 ` Kaartic Sivaraam
  2020-06-17 20:35 ` Junio C Hamano
  0 siblings, 2 replies; 9+ messages in thread
From: Shourya Shukla @ 2020-06-16  7:21 UTC (permalink / raw)
  To: git; +Cc: kaartic.sivaraam, gitster, christian.couder

Hello all!

This is the sixth installation of my weekly blog covering what I have
learned in GSoC and other like stuff.
https://shouryashukla.blogspot.com/2020/06/gsoc-week-55.html

Feel free to comment!

Regards,
Shourya Shukla

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [GSoC] Shourya's Blog
  2020-05-27 16:20 Shourya Shukla
@ 2020-05-28 13:15 ` Kaartic Sivaraam
  0 siblings, 0 replies; 9+ messages in thread
From: Kaartic Sivaraam @ 2020-05-28 13:15 UTC (permalink / raw)
  To: Shourya Shukla, git
  Cc: christian.couder, gitster, Johannes.Schindelin, heba.waly,
	stolee, jnareb

Hi Shourya,


On 27 May 2020 21:50:48 GMT+05:30, Shourya Shukla <shouryashukla.oo@gmail.com> wrote:
>Hello,
>
>This is the third installation of my GSoC blog covering week 3
>https://shouryashukla.blogspot.com/2020/05/gsoc-week-3.html
>
>All feedbacks and suggestions are welcome! :)

I'll mention a couple of things that came to me after re-reading the blog. The blog reads:

> And the final one, comments should be not confusing. to solve the 1st issue in v3, I put up a comment which was:
>
>    The `quiet` option is present for backward compatibility but is currently not used.
>
> Do I even need to explain how ambiguous this is (something which took me one whole patch to realise)?

While you don't have to explain the ambiguity for someone who has read the review discussion, it is possible that someone who has not read Junio's e-mail[1] might not understand what ambiguity is present in that comment. So, it would've been nice if you had explained the ambiguity.

Another thing, you thank Junio for the updated comment (which is nice). But it's not clear from the blog how Junio contributed to that comment. This could've been avoided by adding more information about the context which in this case is (again) Junio's e-mail about the ambiguous comment.

Things to keep in mind for future blogs :)

---
Footnotes:

[1]: https://public-inbox.org/git/xmqqk115ruux.fsf@gitster.c.googlers.com/

-- 
Sivaraam

Sent from my Android device with K-9 Mail. Please excuse my brevity and possible "typso".

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [GSoC] Shourya's Blog
@ 2020-05-27 16:20 Shourya Shukla
  2020-05-28 13:15 ` Kaartic Sivaraam
  0 siblings, 1 reply; 9+ messages in thread
From: Shourya Shukla @ 2020-05-27 16:20 UTC (permalink / raw)
  To: git
  Cc: christian.couder, kaartic.sivaraam, gitster, Johannes.Schindelin,
	heba.waly, stolee, jnareb

Hello,

This is the third installation of my GSoC blog covering week 3
https://shouryashukla.blogspot.com/2020/05/gsoc-week-3.html

All feedbacks and suggestions are welcome! :)
PS: Got a bit late in posting this one cause my internet went down!

Thanks,
Shourya Shukla

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, back to index

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-28  9:39 [GSoC] Shourya's Blog Shourya Shukla
  -- strict thread matches above, loose matches on Subject: below --
2020-07-05 18:38 Shourya Shukla
2020-06-23 18:14 Shourya Shukla
2020-06-16  7:21 Shourya Shukla
2020-06-17  8:38 ` Kaartic Sivaraam
2020-06-20  6:55   ` Shourya Shukla
2020-06-17 20:35 ` Junio C Hamano
2020-05-27 16:20 Shourya Shukla
2020-05-28 13:15 ` Kaartic Sivaraam

git@vger.kernel.org list mirror (unofficial, one of many)

Archives are clonable:
	git clone --mirror https://public-inbox.org/git
	git clone --mirror http://ou63pmih66umazou.onion/git
	git clone --mirror http://czquwvybam4bgbro.onion/git
	git clone --mirror http://hjrcffqmbrq6wope.onion/git

Example config snippet for mirrors

Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.version-control.git
	nntp://ou63pmih66umazou.onion/inbox.comp.version-control.git
	nntp://czquwvybam4bgbro.onion/inbox.comp.version-control.git
	nntp://hjrcffqmbrq6wope.onion/inbox.comp.version-control.git
	nntp://news.gmane.io/gmane.comp.version-control.git

 note: .onion URLs require Tor: https://www.torproject.org/

AGPL code for this site: git clone https://public-inbox.org/public-inbox.git