Forum > FPC development

rtl/sinclairql/sysutils.pp.FileRead might not return a result

(1/1)

lagprogramming:
rtl/sinclairql/sysutils.pp contains the following function:

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---function FileRead(Handle: THandle; out Buffer; Count: LongInt): LongInt;begin  if (Count<=0) then    exit;   { io_fstrg handles EOF }  FileRead := io_fstrg(Handle, -1, @Buffer, Count);  if FileRead < 0 then    FileRead:=-1;end;    I've looked at other file related functions in the file and it looks like in their case it's guaranteed to return a result.
   When working with subversion we could identify a trunk snapshot by revision number. Also we could download a specific development revision number from the server, anytime. Can we identify a snapshot with git and can we download the same snapshot(revision like) later in time in a simmilar way? All I can say is that the above code is found in a rather recent development snapshot, but I don't know how to precisely identify it.

ccrause:

--- Quote from: lagprogramming on October 18, 2021, 04:17:00 pm ---   When working with subversion we could identify a trunk snapshot by revision number. Also we could download a specific development revision number from the server, anytime. Can we identify a snapshot with git and can we download the same snapshot(revision like) later in time in a simmilar way? All I can say is that the above code is found in a rather recent development snapshot, but I don't know how to precisely identify it.

--- End quote ---
The commit for the code of interest can be found with git blame, or this view in gitlab.  This shows that the latest changes were applied in commit 02e63411617bcd6f99f666cf341fba063fb47532.  You can view the state of the whole source tree for that particular commit.  When in the files view of this commit there should be a download icon (next to the clone button) to download a snapshot in zip or some other formats.  Or click on this link.

lagprogramming:

--- Quote from: ccrause on October 18, 2021, 08:48:34 pm ---
--- Quote from: lagprogramming on October 18, 2021, 04:17:00 pm ---   When working with subversion we could identify a trunk snapshot by revision number. Also we could download a specific development revision number from the server, anytime. Can we identify a snapshot with git and can we download the same snapshot(revision like) later in time in a simmilar way? All I can say is that the above code is found in a rather recent development snapshot, but I don't know how to precisely identify it.

--- End quote ---
The commit for the code of interest can be found with git blame, or this view in gitlab.  This shows that the latest changes were applied in commit 02e63411617bcd6f99f666cf341fba063fb47532.  You can view the state of the whole source tree for that particular commit.  When in the files view of this commit there should be a download icon (next to the clone button) to download a snapshot in zip or some other formats.  Or click on this link.

--- End quote ---

Let me reformulate. I'm looking for a general approach, not specific for the above function.
After running

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---git clone https://gitlab.com/freepascal.org/fpc/source.git fpcthere is no text that identifies the snapshot(equivalent to revision number in subversion) of the source code. If I send you the above command and you execute it next week you'll download a different source code than the one I've downloaded. Yours will be an updated one. I want to know what is the command that you should run in order to download the exact snapshot(revision in subversion) as I did. There has to be a two step process: identifying the snapshot I've downloaded and passing that snapshot ID as a parameter when you execute git to download the snapshot.
So, how do I identify the snapshot I have downloaded using "git clone https://gitlab.com/freepascal.org/fpc/source.git fpc" and what is the command that you should execute to download the same snapshot, no matter the day when you execute the command?

trev:
I'm no git expert, but I think you have a choice of:


--- Code: ---trev@macmini8 [/usr/local/share/fpcsrc/3.3.1] $ git describe
3.3.1-9458-gc616832792

trev@macmini8 [/usr/local/share/fpcsrc/3.3.1] $ git rev-parse HEAD
c6168327925ff1bc96f06fe9df952b147bf2b8de

trev@macmini8 [/usr/local/share/fpcsrc/3.3.1] $ git rev-parse --short HEAD
c616832792

trev@macmini8 [/usr/local/share/fpcsrc/3.3.1] $ git log -1
commit c6168327925ff1bc96f06fe9df952b147bf2b8de (HEAD -> main, origin/main, origin/HEAD)
Author: Pierre Muller <pierre@...>
Date:   Mon Oct 18 22:41:38 2021 +0000

  Disable utils packages for wasi OS if required package is not supported or if labels are
 used (which is not supported for wasm32 target CPU)
--- End code ---

To checkout the same clone at a later date:


--- Code: ---git clone [remote_repo] my_repo
cd my_repo
git reset --hard c6168327925ff1bc96f06fe9df952b147bf2b8de
--- End code ---

Or, with an up to date clone, you could simply re-create it with a new branch:


--- Code: ---git checkout -b new_branch_name c6168327925ff1bc96f06fe9df952b147bf2b8de
--- End code ---

[Edit answer part 2 of question]

Navigation

[0] Message Index

Go to full version