From ee1844a9c6828ca9914cfbc12a49915317270600 Mon Sep 17 00:00:00 2001 From: Taylor Shephard Date: Wed, 11 Sep 2024 12:54:27 -0500 Subject: [PATCH 1/8] add ending quote --- docs/lab_08.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/lab_08.html b/docs/lab_08.html index 7cf1e8f..d1821d7 100644 --- a/docs/lab_08.html +++ b/docs/lab_08.html @@ -103,7 +103,7 @@

Commit the change

Committing is the action of saving the changes to the repository. It is like taking a snapshot of the changes. You can always go back to this snapshot later.

So commit now and check the status.

Execute:

-
git commit -m "Using process.argv
+
git commit -m "Using process.argv"
git status

You should see …

From a56c66b2aa321fcd5176fc042466bcf6ce1e6baf Mon Sep 17 00:00:00 2001 From: Taylor Shephard Date: Wed, 11 Sep 2024 12:56:53 -0500 Subject: [PATCH 2/8] add info about committing without -m --- docs/lab_08.html | 34 ++++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/docs/lab_08.html b/docs/lab_08.html index d1821d7..329ed5f 100644 --- a/docs/lab_08.html +++ b/docs/lab_08.html @@ -98,10 +98,40 @@

Goals

-

Commit the change

+ +

Committing using an editor

Ok, enough about staging. Let’s commit what we have staged to the repository.

+

When you used git commit previously to commit the initial version of the hello.js file to the repository, you included the -m flag that gave a comment on the command line. The commit command will allow you to interactively edit a comment for the commit.

+

If you omit the -m flag from the command line, git will pop you into the editor of your choice. The editor is chosen from the following list (in priority order):

+ +

I have the EDITOR variable set to vim. Here's an example of what that would look like:

+
|
+  # Please enter the commit message for your changes. Lines starting
+  # with '#' will be ignored, and an empty message aborts the commit.
+  # On branch master
+  # Changes to be committed:
+  #   (use "git reset HEAD <file>..." to unstage)
+  #
+  #	modified:   hello.js
+  #
+
+

On the first line, you would enter the commit message for example: “Using process.argv”. Save the file and exit the editor. You then would see:

+
git commit
+  Waiting for Vim...
+  [master 569aa96] Using process.argv
+  1 files changed, 1 insertions(+), 1 deletions(-)
+
+

The “Waiting for Vim…” line comes from the vim program which sends the file to a running vim program and waits for the file to be closed. The rest of the output is the standard commit messages.

Committing is the action of saving the changes to the repository. It is like taking a snapshot of the changes. You can always go back to this snapshot later.

-

So commit now and check the status.

+ +

Commit the change

+

For this assignment we will use the -m flag so that you can commit in the simulation terminal. So commit now and check the status.

+

Execute:

git commit -m "Using process.argv"
git status
From c8dac10e8cf06702a18b5de9e152ee1fbd6207ff Mon Sep 17 00:00:00 2001 From: Taylor Shephard Date: Wed, 11 Sep 2024 15:31:05 -0500 Subject: [PATCH 3/8] Update docs/lab_08.html Co-authored-by: Peter Barnum --- docs/lab_08.html | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/lab_08.html b/docs/lab_08.html index 329ed5f..0dbc303 100644 --- a/docs/lab_08.html +++ b/docs/lab_08.html @@ -101,8 +101,9 @@

Goals

Committing using an editor

Ok, enough about staging. Let’s commit what we have staged to the repository.

-

When you used git commit previously to commit the initial version of the hello.js file to the repository, you included the -m flag that gave a comment on the command line. The commit command will allow you to interactively edit a comment for the commit.

-

If you omit the -m flag from the command line, git will pop you into the editor of your choice. The editor is chosen from the following list (in priority order):

+

Previously, when committing the hello.js file, you entered the command git commit -m “Your commit message”. The -m flag will accept the commit message inline, within the “double quotes”. If you enter the command git commit without the -m flag, your default terminal editor will open

+

If you omit the -m flag from the git commit command, git will open your default terminal editor.

+

The editor is chosen from the following list (in priority order):

  • GIT_EDITOR environment variable
  • core.editor configuration setting
  • From 630f799311f6c0eea4da635011f41cf34d26ed87 Mon Sep 17 00:00:00 2001 From: Taylor Shephard Date: Wed, 11 Sep 2024 15:48:01 -0500 Subject: [PATCH 4/8] add info about saving an exiting the editor --- docs/lab_08.html | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/docs/lab_08.html b/docs/lab_08.html index 0dbc303..1405caf 100644 --- a/docs/lab_08.html +++ b/docs/lab_08.html @@ -101,6 +101,7 @@

    Goals

    Committing using an editor

    Ok, enough about staging. Let’s commit what we have staged to the repository.

    +

    Committing is the action of saving the changes to the repository. It is like taking a snapshot of the changes. You can always go back to this snapshot later.

    Previously, when committing the hello.js file, you entered the command git commit -m “Your commit message”. The -m flag will accept the commit message inline, within the “double quotes”. If you enter the command git commit without the -m flag, your default terminal editor will open

    If you omit the -m flag from the git commit command, git will open your default terminal editor.

    The editor is chosen from the following list (in priority order):

    @@ -121,14 +122,20 @@

    Committing using an editor

    # modified: hello.js # -

    On the first line, you would enter the commit message for example: “Using process.argv”. Save the file and exit the editor. You then would see:

    +

    On the first line, you would enter the commit message for example: “Using process.argv”. Save the file and exit the editor.

    +

    Here are some basic commands for vim:

    +
      +
    • To add a commit message, you would type i to enter insert mode, then type your message.
    • +
    • To save and exit the file in vim, you would type :wq and press enter. The : puts vim in command mode, the w writes the file, and the q quits the editor.
    • +
    • To exit without saving, you would type :q! and press enter. The ! forces the quit without saving.
    • +
    +

    Once you have saved and exited the editor, you will see the commit message and the changes that were committed.

    git commit
       Waiting for Vim...
       [master 569aa96] Using process.argv
       1 files changed, 1 insertions(+), 1 deletions(-)
     

    The “Waiting for Vim…” line comes from the vim program which sends the file to a running vim program and waits for the file to be closed. The rest of the output is the standard commit messages.

    -

    Committing is the action of saving the changes to the repository. It is like taking a snapshot of the changes. You can always go back to this snapshot later.

    Commit the change

    For this assignment we will use the -m flag so that you can commit in the simulation terminal. So commit now and check the status.

    From 0e190838aebff8a7f933db8c03fa52ac14bcde8e Mon Sep 17 00:00:00 2001 From: Taylor Shephard Date: Wed, 11 Sep 2024 17:06:57 -0500 Subject: [PATCH 5/8] remove extra tag --- docs/lab_08.html | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/docs/lab_08.html b/docs/lab_08.html index a7ad3a0..af305a3 100644 --- a/docs/lab_08.html +++ b/docs/lab_08.html @@ -99,11 +99,7 @@

    Goals

  • Learn how to commit changes to the repository
-<<<<<<< edit-commit-instructions

Committing using an editor

-======= -

Committing u using an editor

->>>>>>> master

Ok, enough about staging. Let’s commit what we have staged to the repository.

When you used git commit previously to commit the initial version of the hello.js file to the repository, you included the -m flag that gave a comment on the command line. The commit command will allow you to interactively edit a comment for the commit.

If you omit the -m flag from the command line, git will pop you into the editor of your choice. The editor is chosen from the following list (in priority order):

@@ -132,7 +128,6 @@

Committing u using an editor

The “Waiting for Vim…” line comes from the vim program which sends the file to a running vim program and waits for the file to be closed. The rest of the output is the standard commit messages.

Committing is the action of saving the changes to the repository. It is like taking a snapshot of the changes. You can always go back to this snapshot later.

-<<<<<<< edit-commit-instructions

Previously, when committing the hello.js file, you entered the command git commit -m “Your commit message”. The -m flag will accept the commit message inline, within the “double quotes”. If you enter the command git commit without the -m flag, your default terminal editor will open

If you omit the -m flag from the git commit command, git will open your default terminal editor.

The editor is chosen from the following list (in priority order):

@@ -142,18 +137,6 @@

Committing u using an editor

  • VISUAL environment variable
  • EDITOR environment variable
  • -

    I have the EDITOR variable set to vim. Here's an example of what that would look like:

    -
    |
    -  # Please enter the commit message for your changes. Lines starting
    -  # with '#' will be ignored, and an empty message aborts the commit.
    -  # On branch master
    -  # Changes to be committed:
    -  #   (use "git reset HEAD <file>..." to unstage)
    -  #
    -  #	modified:   hello.js
    -  #
    -
    -

    On the first line, you would enter the commit message for example: “Using process.argv”. Save the file and exit the editor.

    Here are some basic commands for vim:

    • To add a commit message, you would type i to enter insert mode, then type your message.
    • @@ -167,8 +150,6 @@

      Committing u using an editor

      1 files changed, 1 insertions(+), 1 deletions(-)

      The “Waiting for Vim…” line comes from the vim program which sends the file to a running vim program and waits for the file to be closed. The rest of the output is the standard commit messages.

      -======= ->>>>>>> master

      Commit the change

      For this assignment we will use the -m flag so that you can commit in the simulation terminal. So commit now and check the status.

      @@ -176,7 +157,6 @@

      Commit the change

      Execute:

      git commit -m "Using process.argv"
      git status
      -

      You should see …

      Output:

      $ git status
      
      From cd91001ceca5d2e66c372b3bec2924bab13a21a6 Mon Sep 17 00:00:00 2001
      From: Taylor Shephard 
      Date: Wed, 11 Sep 2024 17:11:35 -0500
      Subject: [PATCH 6/8] Update docs/lab_08.html
      
      Co-authored-by: Peter Barnum 
      ---
       docs/lab_08.html | 43 ++++++++++++++++++++++++++++++++++++++++---
       1 file changed, 40 insertions(+), 3 deletions(-)
      
      diff --git a/docs/lab_08.html b/docs/lab_08.html
      index af305a3..7eb405e 100644
      --- a/docs/lab_08.html
      +++ b/docs/lab_08.html
      @@ -140,9 +140,46 @@ 

      Committing using an editor

      Here are some basic commands for vim:

      • To add a commit message, you would type i to enter insert mode, then type your message.
      • -
      • To save and exit the file in vim, you would type :wq and press enter. The : puts vim in command mode, the w writes the file, and the q quits the editor.
      • -
      • To exit without saving, you would type :q! and press enter. The ! forces the quit without saving.
      • -
      +
    • + To save and exit the file in vim, you would first press the + Escape key, then type :wq! and press + Enter. +
    • +
    • + To exit without saving, you would type :q! and press + enter. The ! forces the quit without saving. +
    • +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    KeyFunction
    Escexits insert mode
    :puts vim in command mode
    wwrites the file
    qquits the editor
    !forces the editor to quit

    Once you have saved and exited the editor, you will see the commit message and the changes that were committed.

    git commit
       Waiting for Vim...
    
    From 553e6a979addf8f58020a1ad728eca917d91e0e9 Mon Sep 17 00:00:00 2001
    From: Taylor Shephard 
    Date: Wed, 11 Sep 2024 17:18:53 -0500
    Subject: [PATCH 7/8] add css for vim command table
    
    ---
     docs/lab_08.html |  2 +-
     docs/screen.css  | 54 ++++++++++++++++++++++++++++++++++++++++++++++--
     2 files changed, 53 insertions(+), 3 deletions(-)
    
    diff --git a/docs/lab_08.html b/docs/lab_08.html
    index 7eb405e..8c8b7d5 100644
    --- a/docs/lab_08.html
    +++ b/docs/lab_08.html
    @@ -142,7 +142,7 @@ 

    Committing using an editor

  • To add a commit message, you would type i to enter insert mode, then type your message.
  • To save and exit the file in vim, you would first press the - Escape key, then type :wq! and press + esc key, then type :wq! and press Enter.
  • diff --git a/docs/screen.css b/docs/screen.css index 9851540..52e11f1 100644 --- a/docs/screen.css +++ b/docs/screen.css @@ -164,11 +164,11 @@ padding-right: calc(2rem + env(safe-area-inset-right)); flex-grow: 1; counter-reset: content-heading-counter; - outline: none; + outline: none; } #content p, -#content li, { +#content li { line-height: 125%; } @@ -428,3 +428,53 @@ h3 b { content: counter(content-heading-counter); } } + + +/* vim commands table (lab 8) +------------------------------------------------------------------- +*/ + +.shortcuts code { + color: #74e83f; + background: #2e2e2e; +} + +.shortcuts { + border-radius: 5px; + padding: 8px; + border: 1px solid #ddd; +} +.shortcuts th { + text-align: left; + border-bottom: 1px solid #ddd; + margin-bottom: 4px; +} + +.shortcuts td { + padding: 4px 0; + border-bottom: 1px solid #ddd; +} + +.shortcuts td:nth-child(1), +.shortcuts th:nth-child(1) { + padding-right: 8px; + border-right: 1px solid #ddd; + display: flex; + justify-content: center; +} + +.shortcuts td:nth-child(2), +.shortcuts th:nth-child(2) { + padding-left: 8px; +} + +.shortcuts td:nth-child(1) code { + border-radius: 5px; + color: #74e83f; + background: #2e2e2e; +} + +.shortcuts tr:last-child td { + border-bottom: none; + padding-bottom: 0; +} \ No newline at end of file From 8cf267250b0ca3f34f92661c408a9b91b73b005a Mon Sep 17 00:00:00 2001 From: Taylor Shephard Date: Wed, 11 Sep 2024 17:31:36 -0500 Subject: [PATCH 8/8] put table above list --- docs/lab_08.html | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/docs/lab_08.html b/docs/lab_08.html index 8c8b7d5..c280bcc 100644 --- a/docs/lab_08.html +++ b/docs/lab_08.html @@ -138,18 +138,6 @@

    Committing using an editor

  • EDITOR environment variable
  • Here are some basic commands for vim:

    -
      -
    • To add a commit message, you would type i to enter insert mode, then type your message.
    • -
    • - To save and exit the file in vim, you would first press the - esc key, then type :wq! and press - Enter. -
    • -
    • - To exit without saving, you would type :q! and press - enter. The ! forces the quit without saving. -
    • -
    @@ -158,6 +146,10 @@

    Committing using an editor

    + + + + @@ -180,6 +172,18 @@

    Committing using an editor

    ienters insert mode
    Esc exits insert mode
    +
      +
    • To add a commit message, you would type i to enter insert mode, then type your message.
    • +
    • + To save and exit the file in vim, you would first press the + esc key, then type :wq! and press + Enter. +
    • +
    • + To exit without saving, you would type :q! and press + enter. The ! forces the quit without saving. +
    • +

    Once you have saved and exited the editor, you will see the commit message and the changes that were committed.

    git commit
       Waiting for Vim...