Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add solutions for exercises 2 and 3 in 09-conflicts #388

Merged
merged 3 commits into from
Mar 9, 2017
Merged

Add solutions for exercises 2 and 3 in 09-conflicts #388

merged 3 commits into from
Mar 9, 2017

Conversation

tgamblin
Copy link
Contributor

This provides solutions to two exercises on conflicts:

  • resolving conflicts in image files, and
  • a Parson's problem on avoiding conflicts

This does not provide a solution to the first conflict exercise, as it
would be very similar to the lesson itself.

This provides solutions to two exercises on conflicts:
- resolving conflicts in image files, and
- a Parson's problem on avoiding conflicts

This does not provide a solution to the first conflict exercise, as it
would be very similar to the lesson itself.
Copy link

@katyhuff katyhuff left a comment

Choose a reason for hiding this comment

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

This looks great to me!

> > $ git pull origin master
> > ~~~
> > {: .bash}
> >

Choose a reason for hiding this comment

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

Maybe some transition here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated!

@katyhuff
Copy link

@iglpdc @daisieh What do you think of this? It seems like a great addition to me.

@daisieh
Copy link
Contributor

daisieh commented Feb 28, 2017

I'm loath to introduce the idea of committing or dealing with conflicts to binary files. I think it would be confusing to new users who are just being introduced to the concept of diffing on text files.

@tgamblin
Copy link
Contributor Author

This is the solution to an exercise that was already in the episode, so it's already introduced. I suppose you could remove the particular exercise, but I suspect that it's something people will ask. Is there a risk of confusing people if it's buried under an exercise?

@iglpdc
Copy link
Contributor

iglpdc commented Mar 7, 2017

Thanks @tgamblin. I agree with @daisieh that talking about conflicts for binary files maybe a bit too much for a typical learner. However, your text is really well-written and very easy to follow. Instructors are supposed to choose which exercises are done during the workshop, so I think we should merge your PR and let to the instructor's jugedment whether is appropiate for their audience or not.

I also think that this may cover the case when people put a previous project under git, committing in the process a binary file (say some data on a spreadsheet). The spreadsheet changes, they get a conflict which they cannot fix by editing the file, they cannot pull/push anymore and they quit using Git.

I have one minor request though. Could you think in an easy way of creating the jgp (or whatever binary) files? I'm thinking that in a workshop people would not have handy jpgs to share, or they will be too big, or whatever. It would be ideal if there was something using only command line stuff and available in all OSes.

Or maybe just taking a screenshot of the learner's computer would be enough :-)

Any ideas @katyhuff ?

@iglpdc
Copy link
Contributor

iglpdc commented Mar 7, 2017

This could be a solution for generating a small, random file with no personal stuff on it:

dd if=/dev/urandom of=./mars.jpg bs=1 count=1024

but uses dd, which has the "weird" format (from Solaris?) to pass options with = signs, instead of the more common -- that we teach.

@tgamblin
Copy link
Contributor Author

tgamblin commented Mar 7, 2017

Would it be sufficient to check in the jpg's as part of this exercise, and just use curl -O to get them?

@tgamblin
Copy link
Contributor Author

tgamblin commented Mar 7, 2017

Alternately, if you really want random data, you can do this without having to use dd

head --bytes 1024 /dev/urandom > mars.jpg
head --bytes 1024 /dev/urandom > mars2.jpg

@iglpdc
Copy link
Contributor

iglpdc commented Mar 8, 2017

head --bytes 1024 /dev/urandom > mars.jpg

I think that's perfect! All these are commands that people is familiar with from the shell lesson. Could you just add a short sentence with that when you first mention the mars.jpg file? Something like: "If you don't have a real picture of Mars, you can create a small binary file with these commands ..."

@tgamblin
Copy link
Contributor Author

tgamblin commented Mar 9, 2017

@iglpdc: done!

@iglpdc
Copy link
Contributor

iglpdc commented Mar 9, 2017

Very nice! Thanks a lot @tgamblin!

@iglpdc iglpdc merged commit 39602ad into swcarpentry:gh-pages Mar 9, 2017
@tgamblin
Copy link
Contributor Author

tgamblin commented Mar 9, 2017

Thanks everyone!

zkamvar pushed a commit that referenced this pull request May 8, 2023
Add solutions for exercises 2 and 3 in 09-conflicts
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.

4 participants