Skip to content

Conversation

@aholland
Copy link
Contributor

@aholland aholland commented Feb 4, 2016

Added configuration "Compile" to command that sets mainClass. Also added a brief explanation and links to two relevant Stack Overflow questions.

@ochrons
Copy link
Contributor

ochrons commented Feb 4, 2016

Can you squash the commits into one.

If you want the code which is used to run the main class to be written to a file, you can set `persistLauncher := true`.
Note that this will require your main class to be either unique or explicitly set (`mainClass := Some(<name>)`).
Note that this will require your main class to be either unique or explicitly set (`mainClass in Compile := Some(<name>)`).
If you explicitly set `mainClass`, note that it needs to be set on a per-configuration basis (i.e. the part `in Compile` is essential else the setting will be ignored). For further detail see [Stack overflow entry 'How to set mainClass in ScalaJS build.sbt?'](http://stackoverflow.com/questions/34965072/how-to-set-mainclass-in-scalajs-build-sbt) (specific to Scala.js) and [Stack Overflow entry 'How to set main class in build?'](http://stackoverflow.com/questions/6467423/how-to-set-main-class-in-build) (not specific to Scala.js).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few improvements to the text:

essential else , otherwise the setting
For further detail information see the Stack Overflow entry [...] and the Stack Overflow entry

@sjrd
Copy link
Member

sjrd commented Feb 4, 2016

It would also be nice to introduce a blank line (i.e., 2 new lines) after the first . in the commit message.

@aholland
Copy link
Contributor Author

aholland commented Feb 5, 2016

Hi - I'm a git noob. As you can see from the series of commits I did not have an md viewer last night. I also made the commits on my master. Not sure how to squash them now. Tried some basic commands but got a message saying my attempt was the noop case.

@ochrons
Copy link
Contributor

ochrons commented Feb 5, 2016

You'll need to use interactive rebase and then after squashing is done, push the changes with force flag on, to the GH repo. Alternatively you can just copy the changed file somewhere, reset your local repo to original, create new branch, copy the file back and make a new commit :)

@sjrd
Copy link
Member

sjrd commented Feb 5, 2016

A good read: https://sandofsky.com/blog/git-workflow.html
Especially the "Larger Work" section gives explanations on how to rebase+squash.
The whole blog post is a very good rationale for our commit history strategy.

Also added a brief explanation and links to two relevant Stack Overflow questions.
@aholland
Copy link
Contributor Author

aholland commented Feb 5, 2016

Thanks for the tips and the article, which was good.

I have now got everything in one commit on a new branch called clean_attempt2. Should I create a new pull request from that branch? If I do, I guess you will have your desired effect. But I will still be left with the problem, should I want to make any further contributions, that master on my fork is polluted.

Note that

  • my commits had already been pushed to github (which is why you saw them all)
  • my attempt, after reading your material, to do an interactive rebase on the master still resulted in the following 'no operation' interactive file:
noop

# Rebase a95a1b5..a95a1b5 onto a95a1b5 (1 command(s))
#
# Commands:
# p, pick = use commit
# r, reword = use commit, but edit the commit message
# e, edit = use commit, but stop for amending
# s, squash = use commit, but meld into previous commit
# f, fixup = like "squash", but discard this commit's log message
# x, exec = run command (the rest of the line) using shell
# d, drop = remove commit
#
# These lines can be re-ordered; they are executed from top to bottom.
#
# If you remove a line here THAT COMMIT WILL BE LOST.
#
# However, if you remove everything, the rebase will be aborted.
#
# Note that empty commits are commented out

I have been having fun on the command line:

Anthony@Lappy MINGW64 ~
$ cd /c/Workspace/IdeaProjects/scala-js-website/

Anthony@Lappy MINGW64 /c/Workspace/IdeaProjects/scala-js-website (master|REBASE-                                                                         i 1/1)
$ git
usage: git [--version] [--help] [-C <path>] [-c name=value]
           [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]
           [-p | --paginate | --no-pager] [--no-replace-objects] [--bare]
           [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]
           <command> [<args>]

These are common Git commands used in various situations:

start a working area (see also: git help tutorial)
   clone      Clone a repository into a new directory
   init       Create an empty Git repository or reinitialize an existing one

work on the current change (see also: git help everyday)
   add        Add file contents to the index
   mv         Move or rename a file, a directory, or a symlink
   reset      Reset current HEAD to the specified state
   rm         Remove files from the working tree and from the index

examine the history and state (see also: git help revisions)
   bisect     Use binary search to find the commit that introduced a bug
   grep       Print lines matching a pattern
   log        Show commit logs
   show       Show various types of objects
   status     Show the working tree status

grow, mark and tweak your common history
   branch     List, create, or delete branches
   checkout   Switch branches or restore working tree files
   commit     Record changes to the repository
   diff       Show changes between commits, commit and working tree, etc
   merge      Join two or more development histories together
   rebase     Forward-port local commits to the updated upstream head
   tag        Create, list, delete or verify a tag object signed with GPG

collaborate (see also: git help workflows)
   fetch      Download objects and refs from another repository
   pull       Fetch from and integrate with another repository or a local branch
   push       Update remote refs along with associated objects

'git help -a' and 'git help -g' list available subcommands and some
concept guides. See 'git help <command>' or 'git help <concept>'
to read about a specific subcommand or concept.

Anthony@Lappy MINGW64 /c/Workspace/IdeaProjects/scala-js-website (master|REBASE-                                                                         i 1/1)
$ git branch
* (no branch, rebasing master)
  master

Anthony@Lappy MINGW64 /c/Workspace/IdeaProjects/scala-js-website (master|REBASE-i 1/1)
$ git rebase --interactive master

It seems that there is already a rebase-merge directory, and
I wonder if you are in the middle of another rebase.  If that is the
case, please try
        git rebase (--continue | --abort | --skip)
If that is not the case, please
        rm -fr "C:/Workspace/IdeaProjects/scala-js-website/.git/rebase-merge"
and run me again.  I am stopping in case you still have something
valuable there.

Anthony@Lappy MINGW64 /c/Workspace/IdeaProjects/scala-js-website (master|REBASE-i 1/1)
$ git rebase --abort

Anthony@Lappy MINGW64 /c/Workspace/IdeaProjects/scala-js-website (master)
Successfully rebased and updated refs/heads/master.
Rebasing (1/1)
Anthony@Lappy MINGW64 /c/Workspace/IdeaProjects/scala-js-website (master)
$ git
usage: git [--version] [--help] [-C <path>] [-c name=value]
           [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]
           [-p | --paginate | --no-pager] [--no-replace-objects] [--bare]
           [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]
           <command> [<args>]

These are common Git commands used in various situations:

start a working area (see also: git help tutorial)
   clone      Clone a repository into a new directory
   init       Create an empty Git repository or reinitialize an existing one

work on the current change (see also: git help everyday)
   add        Add file contents to the index
   mv         Move or rename a file, a directory, or a symlink
   reset      Reset current HEAD to the specified state
   rm         Remove files from the working tree and from the index

examine the history and state (see also: git help revisions)
   bisect     Use binary search to find the commit that introduced a bug
   grep       Print lines matching a pattern
   log        Show commit logs
   show       Show various types of objects
   status     Show the working tree status

grow, mark and tweak your common history
   branch     List, create, or delete branches
   checkout   Switch branches or restore working tree files
   commit     Record changes to the repository
   diff       Show changes between commits, commit and working tree, etc
   merge      Join two or more development histories together
   rebase     Forward-port local commits to the updated upstream head
   tag        Create, list, delete or verify a tag object signed with GPG

collaborate (see also: git help workflows)
   fetch      Download objects and refs from another repository
   pull       Fetch from and integrate with another repository or a local branch
   push       Update remote refs along with associated objects

'git help -a' and 'git help -g' list available subcommands and some
concept guides. See 'git help <command>' or 'git help <concept>'
to read about a specific subcommand or concept.

Anthony@Lappy MINGW64 /c/Workspace/IdeaProjects/scala-js-website (master)
$ git status
On branch master
Your branch is up-to-date with 'origin/master'.
Untracked files:
  (use "git add <file>..." to include in what will be committed)

        .idea/
        scala-js-website.iml

nothing added to commit but untracked files present (use "git add" to track)

Anthony@Lappy MINGW64 /c/Workspace/IdeaProjects/scala-js-website (master)
$ git checkout master
Already on 'master'
Your branch is up-to-date with 'origin/master'.

Anthony@Lappy MINGW64 /c/Workspace/IdeaProjects/scala-js-website (master)
$ git
usage: git [--version] [--help] [-C <path>] [-c name=value]
           [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]
           [-p | --paginate | --no-pager] [--no-replace-objects] [--bare]
           [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]
           <command> [<args>]

These are common Git commands used in various situations:

start a working area (see also: git help tutorial)
   clone      Clone a repository into a new directory
   init       Create an empty Git repository or reinitialize an existing one

work on the current change (see also: git help everyday)
   add        Add file contents to the index
   mv         Move or rename a file, a directory, or a symlink
   reset      Reset current HEAD to the specified state
   rm         Remove files from the working tree and from the index

examine the history and state (see also: git help revisions)
   bisect     Use binary search to find the commit that introduced a bug
   grep       Print lines matching a pattern
   log        Show commit logs
   show       Show various types of objects
   status     Show the working tree status

grow, mark and tweak your common history
   branch     List, create, or delete branches
   checkout   Switch branches or restore working tree files
   commit     Record changes to the repository
   diff       Show changes between commits, commit and working tree, etc
   merge      Join two or more development histories together
   rebase     Forward-port local commits to the updated upstream head
   tag        Create, list, delete or verify a tag object signed with GPG

collaborate (see also: git help workflows)
   fetch      Download objects and refs from another repository
   pull       Fetch from and integrate with another repository or a local branch
   push       Update remote refs along with associated objects

'git help -a' and 'git help -g' list available subcommands and some
concept guides. See 'git help <command>' or 'git help <concept>'
to read about a specific subcommand or concept.

Anthony@Lappy MINGW64 /c/Workspace/IdeaProjects/scala-js-website (master)
$ git help checkout
Launching default browser to display HTML ...

Anthony@Lappy MINGW64 /c/Workspace/IdeaProjects/scala-js-website (master)
$ git checkout -b cleaned_up_branch
Switched to a new branch 'cleaned_up_branch'

Anthony@Lappy MINGW64 /c/Workspace/IdeaProjects/scala-js-website (cleaned_up_branch)
$ get merge --squash master
bash: get: command not found

Anthony@Lappy MINGW64 /c/Workspace/IdeaProjects/scala-js-website (cleaned_up_branch)
$ git merge --squash master
 (nothing to squash)Already up-to-date.

Anthony@Lappy MINGW64 /c/Workspace/IdeaProjects/scala-js-website (cleaned_up_branch)
$ git checkout master
Switched to branch 'master'
Your branch is up-to-date with 'origin/master'.

Anthony@Lappy MINGW64 /c/Workspace/IdeaProjects/scala-js-website (master)
$ git
usage: git [--version] [--help] [-C <path>] [-c name=value]
           [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]
           [-p | --paginate | --no-pager] [--no-replace-objects] [--bare]
           [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]
           <command> [<args>]

These are common Git commands used in various situations:

start a working area (see also: git help tutorial)
   clone      Clone a repository into a new directory
   init       Create an empty Git repository or reinitialize an existing one

work on the current change (see also: git help everyday)
   add        Add file contents to the index
   mv         Move or rename a file, a directory, or a symlink
   reset      Reset current HEAD to the specified state
   rm         Remove files from the working tree and from the index

examine the history and state (see also: git help revisions)
   bisect     Use binary search to find the commit that introduced a bug
   grep       Print lines matching a pattern
   log        Show commit logs
   show       Show various types of objects
   status     Show the working tree status

grow, mark and tweak your common history
   branch     List, create, or delete branches
   checkout   Switch branches or restore working tree files
   commit     Record changes to the repository
   diff       Show changes between commits, commit and working tree, etc
   merge      Join two or more development histories together
   rebase     Forward-port local commits to the updated upstream head
   tag        Create, list, delete or verify a tag object signed with GPG

collaborate (see also: git help workflows)
   fetch      Download objects and refs from another repository
   pull       Fetch from and integrate with another repository or a local branch
   push       Update remote refs along with associated objects

'git help -a' and 'git help -g' list available subcommands and some
concept guides. See 'git help <command>' or 'git help <concept>'
to read about a specific subcommand or concept.

Anthony@Lappy MINGW64 /c/Workspace/IdeaProjects/scala-js-website (master)
$ git reset a95a1b51dc2c6c05a88a2d023a96869b3af43bbd
Unstaged changes after reset:
M       doc/project/building.md

Anthony@Lappy MINGW64 /c/Workspace/IdeaProjects/scala-js-website (master)
$ git checkout -b clean_attempt2
M       doc/project/building.md
Switched to a new branch 'clean_attempt2'

Anthony@Lappy MINGW64 /c/Workspace/IdeaProjects/scala-js-website (clean_attempt2)
$ git merge --squash master
 (nothing to squash)Already up-to-date.

Anthony@Lappy MINGW64 /c/Workspace/IdeaProjects/scala-js-website (clean_attempt2)
$ git reset a95a1b51dc2c6c05a88a2d023a96869b3af43bbd
Unstaged changes after reset:
M       doc/project/building.md

Anthony@Lappy MINGW64 /c/Workspace/IdeaProjects/scala-js-website (clean_attempt2)
$ git checkout head
M       doc/project/building.md
Note: checking out 'head'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b <new-branch-name>

HEAD is now at a95a1b5... Merge pull request #234 from rockjam/scalajs-version

Anthony@Lappy MINGW64 /c/Workspace/IdeaProjects/scala-js-website ((a95a1b5...))
$ git checkout master
M       doc/project/building.md
Switched to branch 'master'
Your branch is behind 'origin/master' by 11 commits, and can be fast-forwarded.
  (use "git pull" to update your local branch)

Anthony@Lappy MINGW64 /c/Workspace/IdeaProjects/scala-js-website (master)
$ git
usage: git [--version] [--help] [-C <path>] [-c name=value]
           [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]
           [-p | --paginate | --no-pager] [--no-replace-objects] [--bare]
           [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]
           <command> [<args>]

These are common Git commands used in various situations:

start a working area (see also: git help tutorial)
   clone      Clone a repository into a new directory
   init       Create an empty Git repository or reinitialize an existing one

work on the current change (see also: git help everyday)
   add        Add file contents to the index
   mv         Move or rename a file, a directory, or a symlink
   reset      Reset current HEAD to the specified state
   rm         Remove files from the working tree and from the index

examine the history and state (see also: git help revisions)
   bisect     Use binary search to find the commit that introduced a bug
   grep       Print lines matching a pattern
   log        Show commit logs
   show       Show various types of objects
   status     Show the working tree status

grow, mark and tweak your common history
   branch     List, create, or delete branches
   checkout   Switch branches or restore working tree files
   commit     Record changes to the repository
   diff       Show changes between commits, commit and working tree, etc
   merge      Join two or more development histories together
   rebase     Forward-port local commits to the updated upstream head
   tag        Create, list, delete or verify a tag object signed with GPG

collaborate (see also: git help workflows)
   fetch      Download objects and refs from another repository
   pull       Fetch from and integrate with another repository or a local branch
   push       Update remote refs along with associated objects

'git help -a' and 'git help -g' list available subcommands and some
concept guides. See 'git help <command>' or 'git help <concept>'
to read about a specific subcommand or concept.

Anthony@Lappy MINGW64 /c/Workspace/IdeaProjects/scala-js-website (master)
$ git show
commit a95a1b51dc2c6c05a88a2d023a96869b3af43bbd
Merge: 1be064c 5abcd4e
Author: Sébastien Doeraene <sjrdoeraene@gmail.com>
Date:   Mon Feb 1 00:40:25 2016 +0100

    Merge pull request #234 from rockjam/scalajs-version

    Fix #196: Add the Scala.js version on the front page.


Anthony@Lappy MINGW64 /c/Workspace/IdeaProjects/scala-js-website (master)
$ git reset head
Unstaged changes after reset:
M       doc/project/building.md

Anthony@Lappy MINGW64 /c/Workspace/IdeaProjects/scala-js-website (master)
$ git checkout clean_attempt2
M       doc/project/building.md
Switched to branch 'clean_attempt2'

Anthony@Lappy MINGW64 /c/Workspace/IdeaProjects/scala-js-website (clean_attempt2)
$ git merge --squash master
 (nothing to squash)Already up-to-date.

Anthony@Lappy MINGW64 /c/Workspace/IdeaProjects/scala-js-website (clean_attempt2)
$ git
usage: git [--version] [--help] [-C <path>] [-c name=value]
           [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]
           [-p | --paginate | --no-pager] [--no-replace-objects] [--bare]
           [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]
           <command> [<args>]

These are common Git commands used in various situations:

start a working area (see also: git help tutorial)
   clone      Clone a repository into a new directory
   init       Create an empty Git repository or reinitialize an existing one

work on the current change (see also: git help everyday)
   add        Add file contents to the index
   mv         Move or rename a file, a directory, or a symlink
   reset      Reset current HEAD to the specified state
   rm         Remove files from the working tree and from the index

examine the history and state (see also: git help revisions)
   bisect     Use binary search to find the commit that introduced a bug
   grep       Print lines matching a pattern
   log        Show commit logs
   show       Show various types of objects
   status     Show the working tree status

grow, mark and tweak your common history
   branch     List, create, or delete branches
   checkout   Switch branches or restore working tree files
   commit     Record changes to the repository
   diff       Show changes between commits, commit and working tree, etc
   merge      Join two or more development histories together
   rebase     Forward-port local commits to the updated upstream head
   tag        Create, list, delete or verify a tag object signed with GPG

collaborate (see also: git help workflows)
   fetch      Download objects and refs from another repository
   pull       Fetch from and integrate with another repository or a local branch
   push       Update remote refs along with associated objects

'git help -a' and 'git help -g' list available subcommands and some
concept guides. See 'git help <command>' or 'git help <concept>'
to read about a specific subcommand or concept.

Anthony@Lappy MINGW64 /c/Workspace/IdeaProjects/scala-js-website (clean_attempt2)
$ git push
warning: push.default is unset; its implicit value has changed in
Git 2.0 from 'matching' to 'simple'. To squelch this message
and maintain the traditional behavior, use:

  git config --global push.default matching

To squelch this message and adopt the new behavior now, use:

  git config --global push.default simple

When push.default is set to 'matching', git will push local branches
to the remote branches that already exist with the same name.

Since Git 2.0, Git defaults to the more conservative 'simple'
behavior, which only pushes the current branch to the corresponding
remote branch that 'git pull' uses to update the current branch.

See 'git help config' and search for 'push.default' for further information.
(the 'simple' mode was introduced in Git 1.7.11. Use the similar mode
'current' instead of 'simple' if you sometimes use older versions of Git)

fatal: The current branch clean_attempt2 has no upstream branch.
To push the current branch and set the remote as upstream, use

    git push --set-upstream origin clean_attempt2


Anthony@Lappy MINGW64 /c/Workspace/IdeaProjects/scala-js-website (clean_attempt2)
$ git push --set-upstream origin clean_attempt2
Counting objects: 5, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (5/5), done.
Writing objects: 100% (5/5), 874 bytes | 0 bytes/s, done.
Total 5 (delta 4), reused 0 (delta 0)
To https://github.com/aholland/scala-js-website.git
 * [new branch]      clean_attempt2 -> clean_attempt2
Branch clean_attempt2 set up to track remote branch clean_attempt2 from origin.

Anthony@Lappy MINGW64 /c/Workspace/IdeaProjects/scala-js-website (clean_attempt2)
$ git push --simple
error: unknown option `simple'
usage: git push [<options>] [<repository> [<refspec>...]]

    -v, --verbose         be more verbose
    -q, --quiet           be more quiet
    --repo <repository>   repository
    --all                 push all refs
    --mirror              mirror all refs
    --delete              delete refs
    --tags                push tags (can't be used with --all or --mirror)
    -n, --dry-run         dry run
    --porcelain           machine-readable output
    -f, --force           force updates
    --force-with-lease[=<refname>:<expect>]
                          require old value of ref to be at this value
    --recurse-submodules[=<check|on-demand>]
                          control recursive pushing of submodules
    --thin                use thin pack
    --receive-pack <receive-pack>
                          receive pack program
    --exec <receive-pack>
                          receive pack program
    -u, --set-upstream    set upstream for git pull/status
    --progress            force progress reporting
    --prune               prune locally removed refs
    --no-verify           bypass pre-push hook
    --follow-tags         push missing but relevant tags
    --signed[=<yes|no|if-asked>]
                          GPG sign the push
    --atomic              request atomic transaction on remote side


Anthony@Lappy MINGW64 /c/Workspace/IdeaProjects/scala-js-website (clean_attempt2)
$ git help push
Launching default browser to display HTML ...

Anthony@Lappy MINGW64 /c/Workspace/IdeaProjects/scala-js-website (clean_attempt2)
$ git show
commit 26562675adc960931cf0ab1a7ace4ca51c6fa400
Author: Anthony Pieter Holland <anthony.holland@gmail.com>
Date:   Fri Feb 5 14:40:03 2016 +0200

    Added configuration "Compile" to command that sets mainClass.

    Also added a brief explanation and links to two relevant Stack Overflow questions.

diff --git a/doc/project/building.md b/doc/project/building.md
index 2ede5c0..4d0e18e 100644
--- a/doc/project/building.md
+++ b/doc/project/building.md
@@ -75,5 +75,7 @@ You can run your code and tests in fullOpt stage with the following command:
 ## Writing Launcher Code

 If you want the code which is used to run the main class to be written to a file, you can set `persistLauncher := true`.
-Note that this will require your main class to be either unique or explicitly set (`mainClass := Some(<name>)`).
+Note that this will require your main class to be either unique or explicitly set (`mainClass in Compile := Some(<name>)`).
+If you explicitly set `mainClass`, note that it needs to be set on a per-configuration basis (i.e. the part `in Compile` is essential, otherwise the setting will be ignored). For further information see the Stack Overflow entry ['How to set mainClass in ScalaJS build.sbt?'](http://stackoverflow.com/questions/34965072/how-to-set-mainclass-in-scalajs-build-sbt) (specific to Scala.js) and the Stack Overflow entry ['How to set main class in build?'](http://stackoverflow.com/questions/6467423/how-to-set-main-class-in-build) (not specific to Scala.js).
+
 The resulting file in the target folder will have the suffix `-launcher.js`.

Anthony@Lappy MINGW64 /c/Workspace/IdeaProjects/scala-js-website (clean_attempt2)
$ git push
warning: push.default is unset; its implicit value has changed in
Git 2.0 from 'matching' to 'simple'. To squelch this message
and maintain the traditional behavior, use:

  git config --global push.default matching

To squelch this message and adopt the new behavior now, use:

  git config --global push.default simple

When push.default is set to 'matching', git will push local branches
to the remote branches that already exist with the same name.

Since Git 2.0, Git defaults to the more conservative 'simple'
behavior, which only pushes the current branch to the corresponding
remote branch that 'git pull' uses to update the current branch.

See 'git help config' and search for 'push.default' for further information.
(the 'simple' mode was introduced in Git 1.7.11. Use the similar mode
'current' instead of 'simple' if you sometimes use older versions of Git)

error: unable to read askpass response from 'C:/Workspace/Programs/Git/mingw64/libexec/git-core/git-gui--askpass'
Username for 'https://github.com':
remote: Anonymous access to aholland/scala-js-website.git denied.
fatal: Authentication failed for 'https://github.com/aholland/scala-js-website.git/'

Anthony@Lappy MINGW64 /c/Workspace/IdeaProjects/scala-js-website (clean_attempt2)
$ git config --global push default matching
error: key does not contain a section: push

Anthony@Lappy MINGW64 /c/Workspace/IdeaProjects/scala-js-website (clean_attempt2)
$ git config --global push.default matching

Anthony@Lappy MINGW64 /c/Workspace/IdeaProjects/scala-js-website (clean_attempt2)
$ git push
To https://github.com/aholland/scala-js-website.git
 ! [rejected]        master -> master (non-fast-forward)
error: failed to push some refs to 'https://github.com/aholland/scala-js-website.git'
hint: Updates were rejected because a pushed branch tip is behind its remote
hint: counterpart. Check out this branch and integrate the remote changes
hint: (e.g. 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

Anthony@Lappy MINGW64 /c/Workspace/IdeaProjects/scala-js-website (clean_attempt2)
$ git checkout master
Switched to branch 'master'
Your branch is behind 'origin/master' by 11 commits, and can be fast-forwarded.
  (use "git pull" to update your local branch)

Anthony@Lappy MINGW64 /c/Workspace/IdeaProjects/scala-js-website (master)
$ git rebase --interactive master

@sjrd
Copy link
Member

sjrd commented Feb 5, 2016

If clean_attempt2 is in a good state, just take that one and force-push it to the branch of this PR.

@sjrd
Copy link
Member

sjrd commented Feb 5, 2016

LGTM Thanks!

@sjrd sjrd changed the title Writing Launcher Code: mainClass := Some(<name>) should be mainClass *in Compile*... Added configuration "Compile" to command that sets mainClass. Feb 5, 2016
sjrd added a commit that referenced this pull request Feb 5, 2016
Added configuration "Compile" to command that sets mainClass.
@sjrd sjrd merged commit 68af44e into scala-js:master Feb 5, 2016
@aholland
Copy link
Contributor Author

aholland commented Feb 5, 2016

Just a minute... I've been flailing but have a plan.

@aholland
Copy link
Contributor Author

aholland commented Feb 5, 2016

lol sorry guys - I assumed that my own fork's master was what you called "the branch of this PR.". So I ran
git push -f https://github.com/aholland/scala-js-website.git clean_attempt2 master

I was surprised to see that it lopped off all my commits in master and did not add on the only commit in clean_attempt2. And it also closed the PR.

My error was leaving out the colon.
git push -f https://github.com/aholland/scala-js-website.git clean_attempt2:master
did what I expected. I then re-opened the PR. But then it had no commits, so I assumed I had to

  1. redo the initial (mistaken) force push to get it into the inital state, then
  2. re-open the PR, then the do the proper force push again.
    Just as I was doing step 1 I saw the LGTM comment. Now it seems you have the change but the commit no longer exists on my master. Bit confusing for a novice. What would you like me to do? I could re-do the proper force push from clean_atttempt2 as planned, but I suspect the commit id would then be different. Or perhaps it would be identical, because it is a checksum? Let me know what to do pls.

@sjrd
Copy link
Member

sjrd commented Feb 5, 2016

Well, I'm not sure what you did, but the commit I merged was fine. It was one single commit, with a proper commit message and the proper content. You can see that in the Commits tab of this page (up above). As far as I'm concerned, you did well.

@aholland
Copy link
Contributor Author

aholland commented Feb 5, 2016

Thanks. Yes, I saw the commit at the top of this page, but when I go to https://github.com/scala-js/scala-js-website/commits/master... well there was nothing, but it (my change) has now appeared. Perhaps it was on your local machine for a while there. I don't know. Hopefully this will be a little smoother next time! Thanks for the help.

@sjrd
Copy link
Member

sjrd commented Feb 5, 2016

Hopefully this will be a little smoother next time!

One thing that helps is to always create PRs out of separate branches. Never from master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants